Skip to content

Commit f9f43da

Browse files
committed
Update version
2 parents df31a75 + 9bd1665 commit f9f43da

29 files changed

+862
-56
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
# Check for updates to GitHub Actions every week
8+
interval: "weekly"

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v3
2222

2323
- name: Setup Python 3.10
24-
uses: actions/setup-python@v3
24+
uses: actions/setup-python@v4
2525
with:
2626
python-version: "3.10"
2727

@@ -69,7 +69,7 @@ jobs:
6969
- uses: actions/checkout@v3
7070

7171
- name: Setup Python ${{ matrix.python }}
72-
uses: actions/setup-python@v3
72+
uses: actions/setup-python@v4
7373
with:
7474
python-version: ${{ matrix.python }}
7575

@@ -84,7 +84,7 @@ jobs:
8484
run: make test
8585

8686
- name: Upload coverage
87-
uses: codecov/codecov-action@v2
87+
uses: codecov/codecov-action@v3
8888
if: ${{ success() }}
8989

9090
lint:
@@ -97,7 +97,7 @@ jobs:
9797
uses: actions/checkout@v2
9898

9999
- name: Setup Python
100-
uses: actions/setup-python@v2
100+
uses: actions/setup-python@v4
101101

102102
- name: Install tools
103103
run: pip install mypy flake8

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export SHELL := /bin/bash
22

33
test:
4-
pytest -n auto --cov=seaborn --cov=tests --cov-config=.coveragerc tests
4+
pytest -n auto --cov=seaborn --cov=tests --cov-config=setup.cfg tests
55

66
lint:
77
flake8 seaborn

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ Documentation
1919

2020
Online documentation is available at [seaborn.pydata.org](https://seaborn.pydata.org).
2121

22-
The docs include a [tutorial](https://seaborn.pydata.org/tutorial.html), [example gallery](https://seaborn.pydata.org/examples/index.html), [API reference](https://seaborn.pydata.org/api.html), and other useful information.
22+
The docs include a [tutorial](https://seaborn.pydata.org/tutorial.html), [example gallery](https://seaborn.pydata.org/examples/index.html), [API reference](https://seaborn.pydata.org/api.html), [FAQ](https://seaborn.pydata.org/faq), and other useful information.
2323

2424
To build the documentation locally, please refer to [`doc/README.md`](doc/README.md).
2525

26-
There is also a [FAQ](https://github.com/mwaskom/seaborn/wiki/Frequently-Asked-Questions-(FAQs)) page, currently hosted on GitHub.
27-
2826
Dependencies
2927
------------
3028

doc/_docstrings/objects.KDE.ipynb

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "dcc1ae12-bba4-4de9-af8d-543b3d65b42b",
7+
"metadata": {
8+
"tags": [
9+
"hide"
10+
]
11+
},
12+
"outputs": [],
13+
"source": [
14+
"import seaborn.objects as so\n",
15+
"from seaborn import load_dataset\n",
16+
"penguins = load_dataset(\"penguins\")"
17+
]
18+
},
19+
{
20+
"cell_type": "raw",
21+
"id": "1042b991-1471-43bd-934c-43caae3cb2fa",
22+
"metadata": {},
23+
"source": [
24+
"This stat estimates transforms observations into a smooth function representing the estimated density:"
25+
]
26+
},
27+
{
28+
"cell_type": "code",
29+
"execution_count": null,
30+
"id": "2406e2aa-7f0f-4a51-af59-4cef827d28d8",
31+
"metadata": {},
32+
"outputs": [],
33+
"source": [
34+
"p = so.Plot(penguins, x=\"flipper_length_mm\")\n",
35+
"p.add(so.Area(), so.KDE())"
36+
]
37+
},
38+
{
39+
"cell_type": "raw",
40+
"id": "44515f21-683b-420f-967b-4c7568c907d7",
41+
"metadata": {},
42+
"source": [
43+
"Adjust the smoothing bandwidth to see more or fewer details:"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": null,
49+
"id": "d4e6ba5b-4dd2-4210-8cf0-de057dc71e2a",
50+
"metadata": {},
51+
"outputs": [],
52+
"source": [
53+
"p.add(so.Area(), so.KDE(bw_adjust=0.25))"
54+
]
55+
},
56+
{
57+
"cell_type": "raw",
58+
"id": "fd665fe1-a5e4-4742-adc9-e40615d57d08",
59+
"metadata": {},
60+
"source": [
61+
"The curve will extend beyond observed values in the dataset:"
62+
]
63+
},
64+
{
65+
"cell_type": "code",
66+
"execution_count": null,
67+
"id": "4cda1cb8-f663-4f94-aa24-6f1727a41031",
68+
"metadata": {},
69+
"outputs": [],
70+
"source": [
71+
"p2 = p.add(so.Bars(alpha=.3), so.Hist(\"density\"))\n",
72+
"p2.add(so.Line(), so.KDE())"
73+
]
74+
},
75+
{
76+
"cell_type": "raw",
77+
"id": "75235825-d522-4562-aacc-9b7413eabf5d",
78+
"metadata": {},
79+
"source": [
80+
"Control the range of the density curve relative to the observations using `cut`:"
81+
]
82+
},
83+
{
84+
"cell_type": "code",
85+
"execution_count": null,
86+
"id": "a7a9275e-9889-437d-bdc5-18653d2c92ef",
87+
"metadata": {},
88+
"outputs": [],
89+
"source": [
90+
"p2.add(so.Line(), so.KDE(cut=0))"
91+
]
92+
},
93+
{
94+
"cell_type": "raw",
95+
"id": "6a885eeb-81ba-47c6-8402-1bef40544fd1",
96+
"metadata": {},
97+
"source": [
98+
"When observations are assigned to the `y` variable, the density will be shown for `x`:"
99+
]
100+
},
101+
{
102+
"cell_type": "code",
103+
"execution_count": null,
104+
"id": "38b3a0fb-54ff-493a-bd64-f83a12365723",
105+
"metadata": {},
106+
"outputs": [],
107+
"source": [
108+
"so.Plot(penguins, y=\"flipper_length_mm\").add(so.Area(), so.KDE())"
109+
]
110+
},
111+
{
112+
"cell_type": "raw",
113+
"id": "59996340-168e-479f-a0c6-c7e1fcab0fb0",
114+
"metadata": {},
115+
"source": [
116+
"Use `gridsize` to increase or decrease the resolution of the grid where the density is evaluated:"
117+
]
118+
},
119+
{
120+
"cell_type": "code",
121+
"execution_count": null,
122+
"id": "23715820-7df9-40ba-9e74-f11564704dd0",
123+
"metadata": {},
124+
"outputs": [],
125+
"source": [
126+
"p.add(so.Dots(), so.KDE(gridsize=100))"
127+
]
128+
},
129+
{
130+
"cell_type": "raw",
131+
"id": "4c9b6492-98c8-45ab-9f53-681cde2f767a",
132+
"metadata": {},
133+
"source": [
134+
"Or pass `None` to evaluate the density at the original datapoints:"
135+
]
136+
},
137+
{
138+
"cell_type": "code",
139+
"execution_count": null,
140+
"id": "4e1b6810-5c28-43aa-aa61-652521299b51",
141+
"metadata": {},
142+
"outputs": [],
143+
"source": [
144+
"p.add(so.Dots(), so.KDE(gridsize=None))"
145+
]
146+
},
147+
{
148+
"cell_type": "raw",
149+
"id": "0970a56b-0cba-4c40-bb1b-b8e71739df5c",
150+
"metadata": {},
151+
"source": [
152+
"Other variables will define groups for the estimation:"
153+
]
154+
},
155+
{
156+
"cell_type": "code",
157+
"execution_count": null,
158+
"id": "5f0ce0b6-5742-4bc0-9ac3-abedde923684",
159+
"metadata": {},
160+
"outputs": [],
161+
"source": [
162+
"p.add(so.Area(), so.KDE(), color=\"species\")"
163+
]
164+
},
165+
{
166+
"cell_type": "raw",
167+
"id": "22204fcd-4b25-46e5-a170-02b1419c23d5",
168+
"metadata": {},
169+
"source": [
170+
"By default, the density is normalized across all groups (i.e., the joint density is shown); pass `common_norm=False` to show conditional densities:"
171+
]
172+
},
173+
{
174+
"cell_type": "code",
175+
"execution_count": null,
176+
"id": "6ad56958-dc45-4632-94d1-23039ad3ec58",
177+
"metadata": {},
178+
"outputs": [],
179+
"source": [
180+
"p.add(so.Area(), so.KDE(common_norm=False), color=\"species\")"
181+
]
182+
},
183+
{
184+
"cell_type": "raw",
185+
"id": "b1627197-85d1-4476-b4ae-3e93044ee988",
186+
"metadata": {},
187+
"source": [
188+
"Or pass a list of variables to condition on:"
189+
]
190+
},
191+
{
192+
"cell_type": "code",
193+
"execution_count": null,
194+
"id": "58f63734-5afd-4d90-bbfb-fc39c8d1981f",
195+
"metadata": {},
196+
"outputs": [],
197+
"source": [
198+
"(\n",
199+
" p.facet(\"sex\")\n",
200+
" .add(so.Area(), so.KDE(common_norm=[\"col\"]), color=\"species\")\n",
201+
")"
202+
]
203+
},
204+
{
205+
"cell_type": "raw",
206+
"id": "2b7e018e-1374-4939-909c-e95f5ffd086e",
207+
"metadata": {},
208+
"source": [
209+
"This stat can be combined with other transforms, such as :class:`Stack` (when `common_grid=True`):"
210+
]
211+
},
212+
{
213+
"cell_type": "code",
214+
"execution_count": null,
215+
"id": "96e5b2d0-c7e2-47df-91f1-7f9ec0bb08a9",
216+
"metadata": {},
217+
"outputs": [],
218+
"source": [
219+
"p.add(so.Area(), so.KDE(), so.Stack(), color=\"sex\")"
220+
]
221+
},
222+
{
223+
"cell_type": "raw",
224+
"id": "8500ff86-0b1f-4831-954b-08b6df690387",
225+
"metadata": {},
226+
"source": [
227+
"Set `cumulative=True` to integrate the density:"
228+
]
229+
},
230+
{
231+
"cell_type": "code",
232+
"execution_count": null,
233+
"id": "26bb736e-7cfd-421e-b80d-42fa450e88c0",
234+
"metadata": {},
235+
"outputs": [],
236+
"source": [
237+
"p.add(so.Line(), so.KDE(cumulative=True))"
238+
]
239+
},
240+
{
241+
"cell_type": "code",
242+
"execution_count": null,
243+
"id": "e8bfd9d2-ad60-4971-aa7f-71a285f44a20",
244+
"metadata": {},
245+
"outputs": [],
246+
"source": []
247+
}
248+
],
249+
"metadata": {
250+
"kernelspec": {
251+
"display_name": "py310",
252+
"language": "python",
253+
"name": "py310"
254+
},
255+
"language_info": {
256+
"codemirror_mode": {
257+
"name": "ipython",
258+
"version": 3
259+
},
260+
"file_extension": ".py",
261+
"mimetype": "text/x-python",
262+
"name": "python",
263+
"nbconvert_exporter": "python",
264+
"pygments_lexer": "ipython3",
265+
"version": "3.10.0"
266+
}
267+
},
268+
"nbformat": 4,
269+
"nbformat_minor": 5
270+
}

doc/_docstrings/objects.Norm.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
"cell_type": "code",
55
"execution_count": null,
66
"id": "0bfee8b6-1e3e-499d-96ae-735a5c230b32",
7-
"metadata": {},
7+
"metadata": {
8+
"tags": [
9+
"hide"
10+
]
11+
},
812
"outputs": [],
913
"source": [
1014
"import seaborn.objects as so\n",

doc/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Stat objects
8888
Est
8989
Count
9090
Hist
91+
KDE
9192
Perc
9293
PolyFit
9394

doc/installing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ and it can be installed with `conda`::
1919

2020
conda install seaborn
2121

22-
As the main Anaconda repository can be slow to add new releaes, you may prefer using the
22+
As the main Anaconda repository can be slow to add new releases, you may prefer using the
2323
`conda-forge <https://conda-forge.org/>`_ channel::
2424

2525
conda install seaborn -c conda-forge

doc/whatsnew/v0.12.2.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
v0.12.2 (Unreleased)
3+
--------------------
4+
5+
- |Feature| Added the :class:`objects.KDE` stat (:pr:`3111`).
6+
7+
- |Enhancement| Automatic mark widths are now calculated separately for unshared facet axes (:pr:`3119`).
8+
9+
- |Fix| Fixed a bug where legends for numeric variables with large values with be incorrectly shown (i.e. with a missing offset or exponent; :pr:`3187`).
10+
11+
- |Fix| Fixed a regression in v0.12.0 where manually-added labels could have duplicate legend entries (:pr:`3116`).
12+
13+
- |Fix| Fixed a bug in :func:`histplot` with `kde=True` and `log_scale=True` where the curve was not scaled properly (:pr:`3173`).
14+
15+
- |Fix| Fixed a bug in :func:`relplot` where inner axis labels would be shown when axis sharing was disabled (:pr:`3180`).

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dev = [
4242
"mypy",
4343
"pandas-stubs",
4444
"pre-commit",
45+
"flit",
4546
]
4647
docs = [
4748
"numpydoc",

0 commit comments

Comments
 (0)