plotify-charts 0.1.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/PKG-INFO +50 -19
  2. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/README.md +44 -14
  3. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/__init__.py +1 -1
  4. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/base.py +45 -16
  5. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/lollipop_chart.py +17 -1
  6. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/maps/choropleth_map.py +4 -4
  7. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/maps/hexbin_map.py +5 -5
  8. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/numerical/boxplot.py +3 -4
  9. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/numerical/connected_scatter_plot.py +20 -2
  10. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/numerical/density_plot.py +3 -4
  11. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/numerical/scatter_plot.py +13 -4
  12. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/numerical/violin_plot.py +3 -4
  13. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/theme.py +73 -28
  14. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/timeseries/area_chart.py +2 -0
  15. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/timeseries/stacked_area_chart.py +4 -0
  16. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/timeseries/stream_graph.py +5 -0
  17. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/pyproject.toml +17 -4
  18. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/LICENSE +0 -0
  19. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/_inference.py +0 -0
  20. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/auto.py +0 -0
  21. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/__init__.py +0 -0
  22. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/bar_plot.py +0 -0
  23. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/circular_packing.py +0 -0
  24. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/dendrogram.py +0 -0
  25. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/doughnut_chart.py +0 -0
  26. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/parallel_coordinates.py +0 -0
  27. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/pie_chart.py +0 -0
  28. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/radar_chart.py +0 -0
  29. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/sunburst_diagram.py +0 -0
  30. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/treemap.py +0 -0
  31. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/venn_diagram.py +0 -0
  32. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/categorical/word_cloud.py +0 -0
  33. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/maps/__init__.py +0 -0
  34. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/maps/bubble_map.py +0 -0
  35. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/maps/cartogram.py +0 -0
  36. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/maps/connection_map.py +0 -0
  37. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/network/__init__.py +0 -0
  38. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/network/arc_diagram.py +0 -0
  39. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/network/chord_diagram.py +0 -0
  40. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/network/hierarchical_edge_bundling.py +0 -0
  41. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/network/network_diagram.py +0 -0
  42. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/network/sankey_diagram.py +0 -0
  43. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/num_cat/__init__.py +0 -0
  44. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/num_cat/box_plot_by_group.py +0 -0
  45. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/num_cat/grouped_bar_plot.py +0 -0
  46. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/num_cat/grouped_scatter.py +0 -0
  47. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/num_cat/stacked_bar_plot.py +0 -0
  48. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/numerical/__init__.py +0 -0
  49. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/timeseries/__init__.py +0 -0
  50. {plotify_charts-0.1.0 → plotify_charts-0.2.1}/plotify/timeseries/line_chart.py +0 -0
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: plotify-charts
3
- Version: 0.1.0
3
+ Version: 0.2.1
4
4
  Summary: A Python plotting package with a dual Seaborn/Matplotlib + Plotly backend.
5
5
  License: MIT
6
+ License-File: LICENSE
6
7
  Keywords: plotting,visualization,dataviz,matplotlib,plotly,seaborn,charts
7
8
  Author: Kazi1318914
8
9
  Author-email: mahin.kkgb.km@gmail.com
@@ -22,15 +23,15 @@ Provides-Extra: full
22
23
  Provides-Extra: maps
23
24
  Requires-Dist: circlify (>=0.15)
24
25
  Requires-Dist: geopandas (>=0.14) ; extra == "maps" or extra == "full"
25
- Requires-Dist: kaleido (==0.2.1)
26
+ Requires-Dist: kaleido (>=1.3)
26
27
  Requires-Dist: matplotlib (>=3.7)
27
28
  Requires-Dist: matplotlib-venn (>=0.11)
28
29
  Requires-Dist: networkx (>=3.1)
29
30
  Requires-Dist: numpy (>=1.24)
30
31
  Requires-Dist: pandas (>=2.0)
31
- Requires-Dist: plotly (>=5.18)
32
+ Requires-Dist: plotly (>=6.4)
32
33
  Requires-Dist: scipy (>=1.10)
33
- Requires-Dist: seaborn (>=0.13)
34
+ Requires-Dist: seaborn (>=0.13.1)
34
35
  Requires-Dist: squarify (>=0.4.3)
35
36
  Requires-Dist: statsmodels (>=0.14)
36
37
  Requires-Dist: wordcloud (>=1.9)
@@ -40,13 +41,18 @@ Description-Content-Type: text/markdown
40
41
 
41
42
  # Plotify
42
43
 
44
+ [![PyPI version](https://img.shields.io/pypi/v/plotify-charts.svg)](https://pypi.org/project/plotify-charts/)
45
+ [![Python versions](https://img.shields.io/pypi/pyversions/plotify-charts.svg)](https://pypi.org/project/plotify-charts/)
46
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
47
+ [![Tests](https://github.com/Kazi1318914/Plotify/actions/workflows/test.yml/badge.svg)](https://github.com/Kazi1318914/Plotify/actions/workflows/test.yml)
48
+
43
49
  Plotify is a Python plotting package built around two ideas:
44
50
 
45
51
  1. **Auto-pick** — given a dataframe and column names, Plotify infers the
46
52
  right chart from the data shape and types. No need to remember which
47
53
  function to call.
48
54
  2. **Publication-ready by default** — every chart ships with a
49
- colourblind-safe palette, smart tick formatting (1.2K, 3.4M),
55
+ colourblind-safe palette, smart tick formatting (2016, 12K, 3.4M),
50
56
  minimalist spines, and consistent typography on both backends.
51
57
 
52
58
  Every plot can render on either Seaborn/Matplotlib (static images) or
@@ -59,15 +65,15 @@ Time series, Network, Maps) are inspired by
59
65
  ## Demo notebooks
60
66
 
61
67
  The fastest way to see what Plotify can do — runnable notebooks under
62
- [`notebooks/`](notebooks/) with every chart class rendered on both backends:
68
+ [`notebooks/`](https://github.com/Kazi1318914/Plotify/tree/main/notebooks) with every chart class rendered on both backends:
63
69
 
64
- - [`00_quickstart.ipynb`](notebooks/00_quickstart.ipynb) — `auto`, `suggest`, themes
65
- - [`01_numerical.ipynb`](notebooks/01_numerical.ipynb) — Boxplot, Density, Violin, Scatter, ConnectedScatter
66
- - [`02_categorical.ipynb`](notebooks/02_categorical.ipynb) — all 12 categoric charts
67
- - [`03_num_cat.ipynb`](notebooks/03_num_cat.ipynb) — GroupedBar, StackedBar, GroupedScatter, BoxPlotByGroup
68
- - [`04_timeseries.ipynb`](notebooks/04_timeseries.ipynb) — Line, Area, StackedArea, StreamGraph
69
- - [`05_network.ipynb`](notebooks/05_network.ipynb) — Network, Chord, Sankey, Arc, HierarchicalEdgeBundling
70
- - [`06_maps.ipynb`](notebooks/06_maps.ipynb) — Choropleth, Bubble, Hexbin, Cartogram, Connection
70
+ - [`00_quickstart.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/00_quickstart.ipynb) — `auto`, `suggest`, themes
71
+ - [`01_numerical.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/01_numerical.ipynb) — Boxplot, Density, Violin, Scatter, ConnectedScatter
72
+ - [`02_categorical.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/02_categorical.ipynb) — all 12 categoric charts
73
+ - [`03_num_cat.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/03_num_cat.ipynb) — GroupedBar, StackedBar, GroupedScatter, BoxPlotByGroup
74
+ - [`04_timeseries.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/04_timeseries.ipynb) — Line, Area, StackedArea, StreamGraph
75
+ - [`05_network.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/05_network.ipynb) — Network, Chord, Sankey, Arc, HierarchicalEdgeBundling
76
+ - [`06_maps.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/06_maps.ipynb) — Choropleth, Bubble, Hexbin, Cartogram, Connection
71
77
 
72
78
  Outputs are committed, so the notebooks render fully on GitHub without
73
79
  running them.
@@ -149,6 +155,15 @@ you pick:
149
155
  import plotify
150
156
  ```
151
157
 
158
+ Saving a Plotly chart as `.png`, `.svg` or `.pdf` uses Kaleido, which renders
159
+ through Google Chrome. If Chrome isn't installed, run this once:
160
+
161
+ ```bash
162
+ plotly_get_chrome
163
+ ```
164
+
165
+ Saving as `.html`, and every Seaborn/Matplotlib format, works without Chrome.
166
+
152
167
  If you've cloned the repo for development, install with Poetry instead:
153
168
 
154
169
  ```bash
@@ -190,6 +205,21 @@ A few classes only support one backend — `WordCloudPlot`, `VennDiagram`,
190
205
  has no native equivalent. Requesting an unsupported backend raises a
191
206
  `ValueError` at construction time.
192
207
 
208
+ ### Multi-panel figures
209
+
210
+ `Boxplot`, `DensityPlot`, `Violinplot`, `ScatterPlot` and `ConnectedScatterPlot`
211
+ can draw into Matplotlib axes you provide with `ax=`, so several charts can
212
+ share one figure. `save_plot` then saves the whole figure:
213
+
214
+ ```python
215
+ import matplotlib.pyplot as plt
216
+ from plotify.numerical import Boxplot, ScatterPlot
217
+
218
+ fig, (left, right) = plt.subplots(1, 2)
219
+ Boxplot(df, x="cat", y="val", ax=left, title="(a)")
220
+ ScatterPlot(df, x="val", y="val", ax=right, title="(b)").save_plot("figure.png", size=(10, 4))
221
+ ```
222
+
193
223
  ## Chart catalogue (all implemented)
194
224
 
195
225
  | Category | Classes |
@@ -209,13 +239,14 @@ Run the test suite:
209
239
  poetry run pytest
210
240
  ```
211
241
 
212
- The notebooks under [`notebooks/`](notebooks/) are **generated** from
213
- [`scripts/build_notebooks.py`](scripts/build_notebooks.py) — please don't
214
- hand-edit them. After changing an API or a chart class, rebuild and
215
- re-execute in a single step:
242
+ The notebooks under [`notebooks/`](https://github.com/Kazi1318914/Plotify/tree/main/notebooks) are **generated** from
243
+ [`scripts/build_notebooks.py`](https://github.com/Kazi1318914/Plotify/blob/main/scripts/build_notebooks.py) — please don't
244
+ hand-edit them. After changing an API or a chart class, install the
245
+ notebook tools once, then rebuild and re-execute in a single step:
216
246
 
217
247
  ```bash
218
- python scripts/build_notebooks.py --execute
248
+ poetry install --with dev,notebooks --extras full
249
+ poetry run python scripts/build_notebooks.py --execute
219
250
  ```
220
251
 
221
252
  The `--execute` flag runs each notebook via `jupyter nbconvert` so the
@@ -1,12 +1,17 @@
1
1
  # Plotify
2
2
 
3
+ [![PyPI version](https://img.shields.io/pypi/v/plotify-charts.svg)](https://pypi.org/project/plotify-charts/)
4
+ [![Python versions](https://img.shields.io/pypi/pyversions/plotify-charts.svg)](https://pypi.org/project/plotify-charts/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![Tests](https://github.com/Kazi1318914/Plotify/actions/workflows/test.yml/badge.svg)](https://github.com/Kazi1318914/Plotify/actions/workflows/test.yml)
7
+
3
8
  Plotify is a Python plotting package built around two ideas:
4
9
 
5
10
  1. **Auto-pick** — given a dataframe and column names, Plotify infers the
6
11
  right chart from the data shape and types. No need to remember which
7
12
  function to call.
8
13
  2. **Publication-ready by default** — every chart ships with a
9
- colourblind-safe palette, smart tick formatting (1.2K, 3.4M),
14
+ colourblind-safe palette, smart tick formatting (2016, 12K, 3.4M),
10
15
  minimalist spines, and consistent typography on both backends.
11
16
 
12
17
  Every plot can render on either Seaborn/Matplotlib (static images) or
@@ -19,15 +24,15 @@ Time series, Network, Maps) are inspired by
19
24
  ## Demo notebooks
20
25
 
21
26
  The fastest way to see what Plotify can do — runnable notebooks under
22
- [`notebooks/`](notebooks/) with every chart class rendered on both backends:
27
+ [`notebooks/`](https://github.com/Kazi1318914/Plotify/tree/main/notebooks) with every chart class rendered on both backends:
23
28
 
24
- - [`00_quickstart.ipynb`](notebooks/00_quickstart.ipynb) — `auto`, `suggest`, themes
25
- - [`01_numerical.ipynb`](notebooks/01_numerical.ipynb) — Boxplot, Density, Violin, Scatter, ConnectedScatter
26
- - [`02_categorical.ipynb`](notebooks/02_categorical.ipynb) — all 12 categoric charts
27
- - [`03_num_cat.ipynb`](notebooks/03_num_cat.ipynb) — GroupedBar, StackedBar, GroupedScatter, BoxPlotByGroup
28
- - [`04_timeseries.ipynb`](notebooks/04_timeseries.ipynb) — Line, Area, StackedArea, StreamGraph
29
- - [`05_network.ipynb`](notebooks/05_network.ipynb) — Network, Chord, Sankey, Arc, HierarchicalEdgeBundling
30
- - [`06_maps.ipynb`](notebooks/06_maps.ipynb) — Choropleth, Bubble, Hexbin, Cartogram, Connection
29
+ - [`00_quickstart.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/00_quickstart.ipynb) — `auto`, `suggest`, themes
30
+ - [`01_numerical.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/01_numerical.ipynb) — Boxplot, Density, Violin, Scatter, ConnectedScatter
31
+ - [`02_categorical.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/02_categorical.ipynb) — all 12 categoric charts
32
+ - [`03_num_cat.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/03_num_cat.ipynb) — GroupedBar, StackedBar, GroupedScatter, BoxPlotByGroup
33
+ - [`04_timeseries.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/04_timeseries.ipynb) — Line, Area, StackedArea, StreamGraph
34
+ - [`05_network.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/05_network.ipynb) — Network, Chord, Sankey, Arc, HierarchicalEdgeBundling
35
+ - [`06_maps.ipynb`](https://github.com/Kazi1318914/Plotify/blob/main/notebooks/06_maps.ipynb) — Choropleth, Bubble, Hexbin, Cartogram, Connection
31
36
 
32
37
  Outputs are committed, so the notebooks render fully on GitHub without
33
38
  running them.
@@ -109,6 +114,15 @@ you pick:
109
114
  import plotify
110
115
  ```
111
116
 
117
+ Saving a Plotly chart as `.png`, `.svg` or `.pdf` uses Kaleido, which renders
118
+ through Google Chrome. If Chrome isn't installed, run this once:
119
+
120
+ ```bash
121
+ plotly_get_chrome
122
+ ```
123
+
124
+ Saving as `.html`, and every Seaborn/Matplotlib format, works without Chrome.
125
+
112
126
  If you've cloned the repo for development, install with Poetry instead:
113
127
 
114
128
  ```bash
@@ -150,6 +164,21 @@ A few classes only support one backend — `WordCloudPlot`, `VennDiagram`,
150
164
  has no native equivalent. Requesting an unsupported backend raises a
151
165
  `ValueError` at construction time.
152
166
 
167
+ ### Multi-panel figures
168
+
169
+ `Boxplot`, `DensityPlot`, `Violinplot`, `ScatterPlot` and `ConnectedScatterPlot`
170
+ can draw into Matplotlib axes you provide with `ax=`, so several charts can
171
+ share one figure. `save_plot` then saves the whole figure:
172
+
173
+ ```python
174
+ import matplotlib.pyplot as plt
175
+ from plotify.numerical import Boxplot, ScatterPlot
176
+
177
+ fig, (left, right) = plt.subplots(1, 2)
178
+ Boxplot(df, x="cat", y="val", ax=left, title="(a)")
179
+ ScatterPlot(df, x="val", y="val", ax=right, title="(b)").save_plot("figure.png", size=(10, 4))
180
+ ```
181
+
153
182
  ## Chart catalogue (all implemented)
154
183
 
155
184
  | Category | Classes |
@@ -169,13 +198,14 @@ Run the test suite:
169
198
  poetry run pytest
170
199
  ```
171
200
 
172
- The notebooks under [`notebooks/`](notebooks/) are **generated** from
173
- [`scripts/build_notebooks.py`](scripts/build_notebooks.py) — please don't
174
- hand-edit them. After changing an API or a chart class, rebuild and
175
- re-execute in a single step:
201
+ The notebooks under [`notebooks/`](https://github.com/Kazi1318914/Plotify/tree/main/notebooks) are **generated** from
202
+ [`scripts/build_notebooks.py`](https://github.com/Kazi1318914/Plotify/blob/main/scripts/build_notebooks.py) — please don't
203
+ hand-edit them. After changing an API or a chart class, install the
204
+ notebook tools once, then rebuild and re-execute in a single step:
176
205
 
177
206
  ```bash
178
- python scripts/build_notebooks.py --execute
207
+ poetry install --with dev,notebooks --extras full
208
+ poetry run python scripts/build_notebooks.py --execute
179
209
  ```
180
210
 
181
211
  The `--execute` flag runs each notebook via `jupyter nbconvert` so the
@@ -9,7 +9,7 @@ subpackage. For larger applications, prefer importing from the relevant
9
9
  subpackage directly (e.g. ``from plotify.network import SankeyDiagram``).
10
10
  """
11
11
 
12
- __version__ = "0.1.0"
12
+ __version__ = "0.2.1"
13
13
 
14
14
  # Smart picker + theme layer — the headline features.
15
15
  from plotify import theme
@@ -37,6 +37,10 @@ class BasePlot:
37
37
  and produces static images; ``"plotly"`` produces interactive figures.
38
38
  title : str, optional
39
39
  Optional title applied after rendering.
40
+ ax : matplotlib.axes.Axes, optional
41
+ Axes to draw into (Seaborn/Matplotlib backend), for classes that
42
+ accept ``ax``. The chart's :attr:`fig` is then the figure holding
43
+ ``ax``, and :meth:`save_plot` saves that whole figure.
40
44
 
41
45
  Attributes
42
46
  ----------
@@ -53,7 +57,7 @@ class BasePlot:
53
57
  # raises a clear message (rather than letting the render method fail).
54
58
  SUPPORTED_BACKENDS = ("seaborn", "plotly")
55
59
 
56
- def __init__(self, backend="seaborn", title=None):
60
+ def __init__(self, backend="seaborn", title=None, ax=None):
57
61
  """
58
62
  Initialise the base plot.
59
63
 
@@ -63,6 +67,9 @@ class BasePlot:
63
67
  The rendering backend for this instance.
64
68
  title : str, optional
65
69
  Plot title. Applied uniformly across both backends.
70
+ ax : matplotlib.axes.Axes, optional
71
+ Axes to draw into on the Seaborn/Matplotlib backend. Ignored by
72
+ the Plotly backend.
66
73
 
67
74
  Raises
68
75
  ------
@@ -78,6 +85,7 @@ class BasePlot:
78
85
 
79
86
  self._backend = backend
80
87
  self._title = title
88
+ self._ax = ax
81
89
  self._fig = None # populated by _render() in the concrete subclass
82
90
 
83
91
  @property
@@ -114,18 +122,32 @@ class BasePlot:
114
122
  # Each subclass implements them; if a backend is unsupported it can
115
123
  # either raise NotImplementedError inside that method or narrow
116
124
  # ``SUPPORTED_BACKENDS`` so the ValueError is raised in ``__init__``.
117
- if self._backend == "seaborn":
125
+ if self._backend == "seaborn" and self._ax is not None:
126
+ # Draw into the caller's axes without opening a figure. Making
127
+ # them current sends any plt.* calls in the subclass there too;
128
+ # only figures that pyplot manages can be made current.
129
+ if getattr(self._ax.figure.canvas, "manager", None) is not None:
130
+ plt.sca(self._ax)
131
+ self._plot_seaborn()
132
+ self._fig = self._ax.figure
133
+ # Format only the chart's own axes, not the caller's other ones.
134
+ _theme.apply_smart_ticks([self._ax])
135
+ elif self._backend == "seaborn":
118
136
  # Open a fresh matplotlib figure so we never inherit stale axis
119
137
  # state (e.g., a categorical converter set by a prior plot)
120
138
  # from whatever was last drawn onto pyplot's global state.
121
- plt.figure()
139
+ opened = plt.figure()
122
140
  self._plot_seaborn()
123
141
  # Capture whichever figure ended up active. Seaborn helpers
124
142
  # like ``lmplot`` / ``catplot`` create their own FacetGrid, so
125
143
  # we cannot assume our ``plt.figure()`` above is what got drawn.
126
144
  self._fig = plt.gcf()
145
+ # A chart that drew on a figure of its own leaves the one opened
146
+ # above empty; close it so it doesn't stay open.
147
+ if self._fig is not opened and not opened.axes:
148
+ plt.close(opened)
127
149
  # Apply tick formatters that rcParams cannot express directly
128
- # (1.2K / 3.4M / etc.). Safe on date / category axes — the
150
+ # (12K / 3.4M / etc.). Safe on date / category axes — the
129
151
  # helper skips formatters that aren't ScalarFormatter.
130
152
  _theme.apply_smart_ticks_to_current_axes()
131
153
  else:
@@ -150,6 +172,10 @@ class BasePlot:
150
172
  """
151
173
  Save the rendered figure to disk.
152
174
 
175
+ On the Seaborn/Matplotlib backend the figure is saved as drawn, so
176
+ changes made through :attr:`fig` (labels, annotations, limits) appear
177
+ in the file. The figure keeps its own size after saving.
178
+
153
179
  Parameters
154
180
  ----------
155
181
  file_name : str
@@ -188,20 +214,23 @@ class BasePlot:
188
214
  return file_name
189
215
 
190
216
  def _save_seaborn(self, file_name, size):
191
- """Persist the current Matplotlib state to ``file_name``.
217
+ """Save the drawn figure to ``file_name`` at ``size`` inches.
192
218
 
193
- The concrete subclass already called ``self._plot_seaborn()`` during
194
- ``__init__`` which drew onto the current pyplot state. Here we simply
195
- resize the active figure and save it, then close it to keep notebook
196
- environments tidy.
219
+ The figure is saved exactly as drawn, so edits made through
220
+ :attr:`fig` and Plotify's tick formatting are kept. It is resized
221
+ only while saving, then restored to its previous size.
197
222
  """
198
- # Re-render onto a fresh figure so that saving does not depend on
199
- # whatever state the caller's notebook left behind.
200
- fig = plt.figure(figsize=size)
201
- self._plot_seaborn()
202
- plt.savefig(file_name)
203
- plt.close(fig) # prevent figure from popping up in notebooks
204
- plt.ion() # restore interactive mode for any subsequent plots
223
+ if self._fig is None:
224
+ raise RuntimeError(
225
+ "Matplotlib figure has not been drawn; did _plot_seaborn() run?"
226
+ )
227
+
228
+ original_size = self._fig.get_size_inches().copy()
229
+ self._fig.set_size_inches(size)
230
+ try:
231
+ self._fig.savefig(file_name)
232
+ finally:
233
+ self._fig.set_size_inches(original_size)
205
234
 
206
235
  def _save_plotly(self, file_name, size):
207
236
  """Persist the stored Plotly figure to ``file_name``."""
@@ -108,6 +108,9 @@ class LollipopChart(BasePlot):
108
108
  values, categories, s=self.__marker_size**2, color=self.__color
109
109
  )
110
110
 
111
+ x_label, y_label = self._axis_labels()
112
+ ax.set_xlabel(x_label)
113
+ ax.set_ylabel(y_label)
111
114
  if self._title:
112
115
  ax.set_title(self._title)
113
116
 
@@ -164,5 +167,18 @@ class LollipopChart(BasePlot):
164
167
  )
165
168
  )
166
169
 
167
- fig.update_layout(shapes=shapes, title=self._title, showlegend=False)
170
+ x_label, y_label = self._axis_labels()
171
+ fig.update_layout(
172
+ shapes=shapes,
173
+ title=self._title,
174
+ showlegend=False,
175
+ xaxis_title=x_label,
176
+ yaxis_title=y_label,
177
+ )
168
178
  self._fig = fig
179
+
180
+ def _axis_labels(self):
181
+ """Return ``(x label, y label)``: categories and values swap when horizontal."""
182
+ if self.__orient == "v":
183
+ return self.__x, self.__y
184
+ return self.__y, self.__x
@@ -6,8 +6,8 @@ Choropleth map — regions coloured by a numeric value.
6
6
 
7
7
  Both backends are implemented. The Seaborn backend uses a GeoDataFrame's
8
8
  ``plot`` method; the Plotly backend uses :func:`plotly.express.choropleth`
9
- with either a GeoJSON or a built-in ``locationmode`` such as
10
- ``"country names"``.
9
+ with either a GeoJSON or a built-in ``locationmode`` such as ``"ISO-3"``
10
+ (three-letter country codes).
11
11
  """
12
12
 
13
13
  import matplotlib.pyplot as plt
@@ -25,8 +25,8 @@ class ChoroplethMap(BasePlot):
25
25
  * **GeoDataFrame** (both backends) — pass a ``geopandas.GeoDataFrame``
26
26
  via ``df`` and the name of the numeric column via ``value``.
27
27
  * **Location name** (Plotly only) — pass a regular DataFrame plus
28
- ``locations`` (column name) and ``locationmode="country names"`` (or
29
- any mode :func:`plotly.express.choropleth` accepts) in ``kwargs``.
28
+ ``locations`` (column name) and ``locationmode="ISO-3"`` (or any
29
+ mode :func:`plotly.express.choropleth` accepts) in ``kwargs``.
30
30
  """
31
31
 
32
32
  def __init__(
@@ -16,8 +16,8 @@ class HexbinMap(BasePlot):
16
16
  Hexbin aggregation of (lat, lon) points.
17
17
 
18
18
  Seaborn backend uses :func:`matplotlib.pyplot.hexbin`. Plotly backend
19
- uses :func:`plotly.figure_factory.create_hexbin_mapbox` if Mapbox tiles
20
- are available, falling back to a projected hexbin otherwise.
19
+ uses :func:`plotly.figure_factory.create_hexbin_map` on OpenStreetMap
20
+ tiles, so no Mapbox token is needed.
21
21
  """
22
22
 
23
23
  def __init__(
@@ -81,8 +81,8 @@ class HexbinMap(BasePlot):
81
81
  plt.title(self._title)
82
82
 
83
83
  def _plot_plotly(self):
84
- """Render using :func:`plotly.figure_factory.create_hexbin_mapbox`."""
85
- fig = ff.create_hexbin_mapbox(
84
+ """Render using :func:`plotly.figure_factory.create_hexbin_map`."""
85
+ fig = ff.create_hexbin_map(
86
86
  data_frame=self.__df,
87
87
  lat=self.__lat,
88
88
  lon=self.__lon,
@@ -92,5 +92,5 @@ class HexbinMap(BasePlot):
92
92
  **self.__kwargs,
93
93
  )
94
94
  # Use OpenStreetMap tiles to avoid needing a Mapbox token.
95
- fig.update_layout(mapbox_style="open-street-map", title=self._title)
95
+ fig.update_layout(map_style="open-street-map", title=self._title)
96
96
  self._fig = fig
@@ -6,7 +6,6 @@ Dual-backend Boxplot class. Wraps :func:`seaborn.boxplot` on the Seaborn
6
6
  backend and :func:`plotly.express.box` on the Plotly backend.
7
7
  """
8
8
 
9
- import matplotlib.pyplot as plt
10
9
  import plotly.express as px
11
10
  import seaborn as sns
12
11
 
@@ -112,12 +111,12 @@ class Boxplot(BasePlot):
112
111
  self.__ax = ax
113
112
  self.__kwargs = kwargs
114
113
 
115
- super().__init__(backend=backend, title=title)
114
+ super().__init__(backend=backend, title=title, ax=ax)
116
115
  self._render()
117
116
 
118
117
  def _plot_seaborn(self):
119
118
  """Render the boxplot using :func:`seaborn.boxplot`."""
120
- sns.boxplot(
119
+ ax = sns.boxplot(
121
120
  x=self.__x,
122
121
  y=self.__y,
123
122
  hue=self.__hue,
@@ -137,7 +136,7 @@ class Boxplot(BasePlot):
137
136
  **self.__kwargs,
138
137
  )
139
138
  if self._title:
140
- plt.title(self._title)
139
+ ax.set_title(self._title)
141
140
 
142
141
  def _plot_plotly(self):
143
142
  """Render the boxplot using :func:`plotly.express.box`."""
@@ -18,7 +18,9 @@ class ConnectedScatterPlot(BasePlot):
18
18
 
19
19
  Each series may be described by a dict in ``plots`` containing at least
20
20
  ``'x'`` and ``'y'`` and optionally ``'linestyle'``, ``'marker'``,
21
- ``'color'``, ``'linewidth'``, ``'label'``.
21
+ ``'color'``, ``'linewidth'``, ``'label'``. Points are drawn as circles
22
+ unless ``'marker'`` says otherwise. An axis is labelled with its column
23
+ name when every series uses the same column for it.
22
24
  """
23
25
 
24
26
  def __init__(
@@ -71,7 +73,7 @@ class ConnectedScatterPlot(BasePlot):
71
73
  if x and y:
72
74
  self.__plots = [{"x": x, "y": y, **self.__default_style, **kwargs}]
73
75
 
74
- super().__init__(backend=backend, title=title)
76
+ super().__init__(backend=backend, title=title, ax=ax)
75
77
  self._render()
76
78
 
77
79
  def _plot_seaborn(self):
@@ -84,8 +86,15 @@ class ConnectedScatterPlot(BasePlot):
84
86
  spec = dict(plot)
85
87
  x = spec.pop("x")
86
88
  y = spec.pop("y")
89
+ spec.setdefault("marker", "o")
87
90
  self.__ax.plot(self.__df[x], self.__df[y], **spec)
88
91
 
92
+ x_label, y_label = self._shared_column("x"), self._shared_column("y")
93
+ if x_label:
94
+ self.__ax.set_xlabel(x_label)
95
+ if y_label:
96
+ self.__ax.set_ylabel(y_label)
97
+
89
98
  if self._title:
90
99
  self.__ax.set_title(self._title)
91
100
 
@@ -115,6 +124,15 @@ class ConnectedScatterPlot(BasePlot):
115
124
  marker=dict(symbol=spec.get("marker", "circle")),
116
125
  )
117
126
  )
127
+ fig.update_layout(
128
+ xaxis_title=self._shared_column("x"),
129
+ yaxis_title=self._shared_column("y"),
130
+ )
118
131
  if self._title:
119
132
  fig.update_layout(title=self._title)
120
133
  self._fig = fig
134
+
135
+ def _shared_column(self, key):
136
+ """Return the column every series uses for ``key``, or None if they differ."""
137
+ columns = {plot[key] for plot in self.__plots}
138
+ return columns.pop() if len(columns) == 1 else None
@@ -5,7 +5,6 @@ plotify.numerical.density_plot
5
5
  Dual-backend kernel-density / density-contour plot.
6
6
  """
7
7
 
8
- import matplotlib.pyplot as plt
9
8
  import plotly.express as px
10
9
  import seaborn as sns
11
10
 
@@ -111,12 +110,12 @@ class DensityPlot(BasePlot):
111
110
  self.__ax = ax
112
111
  self.__kwargs = kwargs
113
112
 
114
- super().__init__(backend=backend, title=title)
113
+ super().__init__(backend=backend, title=title, ax=ax)
115
114
  self._render()
116
115
 
117
116
  def _plot_seaborn(self):
118
117
  """Render using :func:`seaborn.kdeplot`."""
119
- sns.kdeplot(
118
+ ax = sns.kdeplot(
120
119
  data=self.__df,
121
120
  x=self.__x,
122
121
  y=self.__y,
@@ -148,7 +147,7 @@ class DensityPlot(BasePlot):
148
147
  **self.__kwargs,
149
148
  )
150
149
  if self._title:
151
- plt.title(self._title)
150
+ ax.set_title(self._title)
152
151
 
153
152
  def _plot_plotly(self):
154
153
  """Render using Plotly Express.
@@ -54,7 +54,8 @@ class ScatterPlot(BasePlot):
54
54
  style : {"scatter", "reg", "lm"}, default="scatter"
55
55
  Which Seaborn function / Plotly trendline to use.
56
56
  ax : matplotlib.axes.Axes, optional
57
- Pre-existing axes for the seaborn backend.
57
+ Pre-existing axes for the seaborn backend. Not available with
58
+ ``style="lm"``, which always draws its own figure.
58
59
  title : str, optional
59
60
  Plot title.
60
61
  default_style : dict, optional
@@ -68,7 +69,17 @@ class ScatterPlot(BasePlot):
68
69
  Returns
69
70
  -------
70
71
  None
72
+
73
+ Raises
74
+ ------
75
+ ValueError
76
+ If ``style="lm"`` is combined with ``ax``.
71
77
  """
78
+ if style == "lm" and ax is not None:
79
+ raise ValueError(
80
+ "style='lm' uses seaborn.lmplot, which always draws its own "
81
+ "figure, so it can't draw into ax. Use style='reg' instead."
82
+ )
72
83
  self.__df = df
73
84
  self.__plots = plots or []
74
85
  self.__style = style
@@ -81,13 +92,11 @@ class ScatterPlot(BasePlot):
81
92
  if x and y:
82
93
  self.__plots = [{"x": x, "y": y, **self.__default_style, **kwargs}]
83
94
 
84
- super().__init__(backend=backend, title=title)
95
+ super().__init__(backend=backend, title=title, ax=ax)
85
96
  self._render()
86
97
 
87
98
  def _plot_seaborn(self):
88
99
  """Render via Seaborn using the chosen ``style``."""
89
- sns.set_style("darkgrid")
90
-
91
100
  for plot in self.__plots:
92
101
  # Copy so we don't mutate the caller's dict across renders.
93
102
  spec = dict(plot)
@@ -6,7 +6,6 @@ Dual-backend violin plot wrapping :func:`seaborn.violinplot` and
6
6
  :func:`plotly.express.violin`.
7
7
  """
8
8
 
9
- import matplotlib.pyplot as plt
10
9
  import plotly.express as px
11
10
  import seaborn as sns
12
11
 
@@ -90,14 +89,14 @@ class Violinplot(BasePlot):
90
89
  self.__ax = ax
91
90
  self.__kwargs = kwargs
92
91
 
93
- super().__init__(backend=backend, title=title)
92
+ super().__init__(backend=backend, title=title, ax=ax)
94
93
  self._render()
95
94
 
96
95
  def _plot_seaborn(self):
97
96
  """Render using :func:`seaborn.violinplot`."""
98
97
  # Newer seaborn versions renamed ``bw`` to ``bw_method``. We pass via
99
98
  # kwargs after catching the legacy name so older installs still work.
100
- sns.violinplot(
99
+ ax = sns.violinplot(
101
100
  x=self.__x,
102
101
  y=self.__y,
103
102
  hue=self.__hue,
@@ -119,7 +118,7 @@ class Violinplot(BasePlot):
119
118
  **self.__kwargs,
120
119
  )
121
120
  if self._title:
122
- plt.title(self._title)
121
+ ax.set_title(self._title)
123
122
 
124
123
  def _plot_plotly(self):
125
124
  """Render using :func:`plotly.express.violin`."""
@@ -39,7 +39,7 @@ class Theme:
39
39
  tick_size: int = 10
40
40
  # Which spines (axes borders) to keep visible.
41
41
  spines: tuple[str, ...] = ("left", "bottom")
42
- # If True, format large numeric ticks as 1.2K / 3.4M / 5B etc.
42
+ # If True, format large numeric ticks as 12K / 3.4M / 5B etc.
43
43
  smart_ticks: bool = True
44
44
  # Extra metadata set by helpers — not user-facing but lets the theme be
45
45
  # extended without breaking the dataclass signature.
@@ -233,47 +233,91 @@ def _apply_plotly(theme: Theme) -> None:
233
233
 
234
234
  # ---- helpers ------------------------------------------------------------
235
235
 
236
- def smart_formatter() -> mticker.Formatter:
237
- """Return a matplotlib formatter that prints ``1.2K`` / ``3.4M`` / ``5B``.
236
+ # Axes whose largest tick reaches this use K/M/B. Below it, numbers are
237
+ # written in full, so years stay 2016 instead of 2K, as in Plotly.
238
+ _ABBREVIATE_FROM = 10_000
239
+ _SCALES = ((1e9, "B"), (1e6, "M"), (1e3, "K"))
240
+
241
+
242
+ def _tick_step(locs) -> float | None:
243
+ """Smallest gap between neighbouring ticks, or None with fewer than two."""
244
+ distinct = sorted({float(loc) for loc in locs})
245
+ gaps = [high - low for low, high in zip(distinct, distinct[1:])]
246
+ return min(gaps) if gaps else None
247
+
248
+
249
+ def _decimals_for(step: float) -> int:
250
+ """Fewest decimals that show a tick gap of ``step`` exactly (at most 12)."""
251
+ for decimals in range(13):
252
+ scaled = step * 10**decimals
253
+ if abs(scaled - round(scaled)) <= 1e-6 * max(1.0, abs(scaled)):
254
+ return decimals
255
+ return 12
238
256
 
239
- Plotly applies ``tickformat="~s"`` directly via the template so this is
240
- only used by the seaborn / matplotlib path.
241
- """
242
257
 
243
- def _fmt(value: float, _pos: int) -> str:
258
+ def _trim(text: str) -> str:
259
+ """Drop trailing zeros after a decimal point: ``1.50`` -> ``1.5``, ``2.0`` -> ``2``."""
260
+ return text.rstrip("0").rstrip(".") if "." in text else text
261
+
262
+
263
+ class _SmartFormatter(mticker.Formatter):
264
+ """Tick labels such as ``2016``, ``15K``, ``1.25M`` and ``3B``."""
265
+
266
+ _ticks = ()
267
+
268
+ def set_locs(self, locs):
269
+ # Matplotlib passes every tick position here before asking for labels.
270
+ super().set_locs(locs)
271
+ self._ticks = tuple(locs)
272
+
273
+ def __call__(self, value, pos=None):
244
274
  if value == 0:
245
275
  return "0"
246
- absval = abs(value)
247
- # Sub-unit values: keep significant figures, no SI prefix.
248
- if absval < 1:
249
- return f"{value:.2g}"
250
- if absval < 1_000:
251
- # Drop trailing .0 for ints.
252
- if float(value).is_integer():
253
- return f"{int(value)}"
254
- return f"{value:g}"
255
- if absval < 1_000_000:
256
- return f"{value / 1_000:.1f}K".replace(".0K", "K")
257
- if absval < 1_000_000_000:
258
- return f"{value / 1_000_000:.1f}M".replace(".0M", "M")
259
- return f"{value / 1_000_000_000:.1f}B".replace(".0B", "B")
260
-
261
- return mticker.FuncFormatter(_fmt)
276
+ step = _tick_step(self._ticks)
277
+ largest = max((abs(tick) for tick in self._ticks), default=abs(value))
278
+ if largest >= _ABBREVIATE_FROM and abs(value) >= 1_000:
279
+ scale, suffix = next(pair for pair in _SCALES if abs(value) >= pair[0])
280
+ decimals = 1 if step is None else _decimals_for(step / scale)
281
+ return _trim(f"{value / scale:.{decimals}f}") + suffix
282
+ if step is None:
283
+ return f"{int(value)}" if float(value).is_integer() else f"{value:.6g}"
284
+ return _trim(f"{value:.{_decimals_for(step)}f}")
285
+
286
+
287
+ def smart_formatter() -> mticker.Formatter:
288
+ """Return a Matplotlib formatter that prints ``2016``, ``15K``, ``1.25M`` or ``3B``.
289
+
290
+ Numbers are written in full unless the axis reaches 10,000; from there K,
291
+ M and B are used. Each tick gets just enough decimals to tell it apart
292
+ from its neighbours, and trailing zeros are dropped. This matches the
293
+ labels Plotly draws by default, so the Plotly backend needs no formatter.
294
+ """
295
+ return _SmartFormatter()
262
296
 
263
297
 
264
298
  def apply_smart_ticks_to_current_axes() -> None:
265
- """Apply :func:`smart_formatter` to numeric tick axes of every open axes.
299
+ """Apply :func:`smart_formatter` to every axes of the current figure.
266
300
 
267
301
  Called after a seaborn render so the tick formatting reflects the theme
268
302
  even though it lives in axis-formatter space (which rcParams cannot
269
- express directly). Wrapped in try/except per-axis so we never break a
270
- chart that uses non-numeric ticks (dates, categories).
303
+ express directly).
304
+ """
305
+ import matplotlib.pyplot as plt # local: avoids import-time backend lock
306
+
307
+ apply_smart_ticks(plt.gcf().get_axes())
308
+
309
+
310
+ def apply_smart_ticks(axes) -> None:
311
+ """Apply :func:`smart_formatter` to the numeric tick axes of ``axes``.
312
+
313
+ Only axes that still use Matplotlib's default ``ScalarFormatter`` change,
314
+ so date, category and log axes keep their own formatters. Wrapped in
315
+ try/except per axis so a chart with unusual ticks never breaks.
271
316
  """
272
317
  if not _CURRENT.smart_ticks or _CURRENT.name == "none":
273
318
  return
274
- import matplotlib.pyplot as plt # local: avoids import-time backend lock
275
319
 
276
- for ax in plt.gcf().get_axes():
320
+ for ax in axes:
277
321
  for axis in (ax.xaxis, ax.yaxis):
278
322
  try:
279
323
  # Only override if the axis currently uses a default scalar
@@ -292,6 +336,7 @@ __all__ = [
292
336
  "get_current",
293
337
  "set",
294
338
  "apply_current",
339
+ "apply_smart_ticks",
295
340
  "apply_smart_ticks_to_current_axes",
296
341
  "smart_formatter",
297
342
  ]
@@ -74,6 +74,8 @@ class AreaChart(BasePlot):
74
74
  # Draw the outline first so that the fill does not wash out the line.
75
75
  plt.plot(x_vals, y_vals, color=self.__color)
76
76
  plt.fill_between(x_vals, y_vals, color=self.__color, alpha=self.__alpha)
77
+ plt.xlabel(self.__x)
78
+ plt.ylabel(self.__y)
77
79
  if self._title:
78
80
  plt.title(self._title)
79
81
 
@@ -102,6 +102,10 @@ class StackedAreaChart(BasePlot):
102
102
  alpha=self.__alpha,
103
103
  )
104
104
  plt.legend(loc="upper left")
105
+ plt.xlabel(self.__x)
106
+ # Wide form stacks several columns, so there is no single y column name.
107
+ if isinstance(self.__y, str):
108
+ plt.ylabel(self.__y)
105
109
  if self._title:
106
110
  plt.title(self._title)
107
111
 
@@ -112,5 +112,10 @@ class StreamGraph(BasePlot):
112
112
  # carry the information, absolute values do not.
113
113
  plt.gca().set_yticks([])
114
114
  plt.legend(loc="upper left")
115
+ plt.xlabel(self.__x)
116
+ # Without ticks, the y label still says what the band widths measure.
117
+ # Wide form stacks several columns, so there is no single y column name.
118
+ if isinstance(self.__y, str):
119
+ plt.ylabel(self.__y)
115
120
  if self._title:
116
121
  plt.title(self._title)
@@ -3,7 +3,7 @@
3
3
  # the ``packages`` field below), so users do ``pip install plotify-charts``
4
4
  # but still write ``import plotify``.
5
5
  name = "plotify-charts"
6
- version = "0.1.0"
6
+ version = "0.2.1"
7
7
  description = "A Python plotting package with a dual Seaborn/Matplotlib + Plotly backend."
8
8
  authors = ["Kazi1318914 <mahin.kkgb.km@gmail.com>"]
9
9
  readme = "README.md"
@@ -41,9 +41,9 @@ python = ">=3.10,<3.13"
41
41
  pandas = ">=2.0"
42
42
  numpy = ">=1.24"
43
43
  matplotlib = ">=3.7"
44
- seaborn = ">=0.13"
45
- plotly = ">=5.18"
46
- kaleido = "0.2.1"
44
+ seaborn = ">=0.13.1"
45
+ plotly = ">=6.4"
46
+ kaleido = ">=1.3"
47
47
  scipy = ">=1.10"
48
48
  # Required by plotly.express scatter ``trendline="ols"`` (used by
49
49
  # ScatterPlot when ``style`` is "reg" or "lm" on the Plotly backend).
@@ -66,6 +66,13 @@ full = ["geopandas"]
66
66
  [tool.poetry.group.dev.dependencies]
67
67
  pytest = ">=8.0"
68
68
 
69
+ [tool.poetry.group.notebooks]
70
+ optional = true
71
+
72
+ [tool.poetry.group.notebooks.dependencies]
73
+ nbconvert = ">=7.16"
74
+ ipykernel = ">=6.29"
75
+
69
76
  [build-system]
70
77
  requires = ["poetry-core>=1.7.0"]
71
78
  build-backend = "poetry.core.masonry.api"
@@ -73,3 +80,9 @@ build-backend = "poetry.core.masonry.api"
73
80
  [tool.pytest.ini_options]
74
81
  testpaths = ["tests"]
75
82
  addopts = "-q"
83
+ filterwarnings = [
84
+ "error::DeprecationWarning:plotify",
85
+ "error::PendingDeprecationWarning:plotify",
86
+ "error::FutureWarning:plotify",
87
+ "ignore:The kopts argument is ignored if using a server:UserWarning",
88
+ ]
File without changes