MatplotLibAPI 4.0.2__py3-none-any.whl → 4.0.4__py3-none-any.whl

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.
MatplotLibAPI/table.py CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Any, List, Optional, Tuple
4
4
  import pandas as pd
5
- import matplotlib.pyplot as plt
6
5
  from matplotlib.axes import Axes
7
6
  from matplotlib.figure import Figure
8
7
  from matplotlib.transforms import Bbox
@@ -10,7 +9,6 @@ from matplotlib.table import Table
10
9
 
11
10
  from .base_plot import BasePlot
12
11
 
13
- from .utils import _get_axis
14
12
 
15
13
  from .style_template import (
16
14
  FIG_SIZE,
@@ -62,7 +60,7 @@ class TablePlot(BasePlot):
62
60
  ax: Optional[Axes] = None,
63
61
  **kwargs: Any,
64
62
  ) -> Axes:
65
- plot_ax = _get_axis(ax)
63
+ plot_ax = BasePlot.get_axis(ax)
66
64
 
67
65
  if sort_by is None:
68
66
  sort_by = self.cols[0]
@@ -9,7 +9,7 @@ from matplotlib.axes import Axes
9
9
  from matplotlib.figure import Figure
10
10
 
11
11
  from .base_plot import BasePlot
12
- from .utils import _get_axis
12
+
13
13
  from .style_template import (
14
14
  TIMESERIE_STYLE_TEMPLATE,
15
15
  FIG_SIZE,
@@ -210,7 +210,7 @@ class TimeSeriePlot(BasePlot):
210
210
  format_funcs = format_func(
211
211
  style.format_funcs, label=self.label, x=self.x, y=self.y
212
212
  )
213
- plot_ax = _get_axis(ax)
213
+ plot_ax = BasePlot.get_axis(ax)
214
214
  _plot_timeserie_lines(
215
215
  plot_ax, df, self.label, self.x, self.y, std, style, format_funcs
216
216
  )
MatplotLibAPI/types.py ADDED
@@ -0,0 +1,6 @@
1
+ """Shared type aliases for MatplotLibAPI."""
2
+
3
+ from typing import Literal
4
+ from typing_extensions import TypeAlias
5
+
6
+ CorrelationMethod: TypeAlias = Literal["pearson", "kendall", "spearman"]
MatplotLibAPI/waffle.py CHANGED
@@ -4,7 +4,6 @@ from typing import Any, Optional, Tuple, cast
4
4
 
5
5
  import pandas as pd
6
6
  import seaborn as sns
7
- import matplotlib.pyplot as plt
8
7
  from matplotlib.axes import Axes
9
8
  from matplotlib.figure import Figure
10
9
  from matplotlib.patches import Rectangle
@@ -12,7 +11,6 @@ from matplotlib.patches import Rectangle
12
11
  from .base_plot import BasePlot
13
12
 
14
13
  from .style_template import PIE_STYLE_TEMPLATE, StyleTemplate, validate_dataframe
15
- from .utils import _get_axis
16
14
 
17
15
 
18
16
  class WaffleChart(BasePlot):
@@ -65,7 +63,7 @@ class WaffleChart(BasePlot):
65
63
  total = float(value_series.sum())
66
64
  squares = rows * rows
67
65
  colors = sns.color_palette(style.palette, n_colors=len(self._obj))
68
- plot_ax = _get_axis(ax)
66
+ plot_ax = BasePlot.get_axis(ax)
69
67
  plot_ax.set_aspect("equal")
70
68
 
71
69
  start = 0
@@ -7,7 +7,6 @@ from typing import Any, Dict, Iterable, Optional, Sequence, Tuple, Union
7
7
  from matplotlib.transforms import BboxBase
8
8
  import numpy as np
9
9
  import pandas as pd
10
- import matplotlib.pyplot as plt
11
10
  from matplotlib import colormaps
12
11
  from matplotlib.axes import Axes
13
12
  from matplotlib.backend_bases import FigureCanvasBase
@@ -16,7 +15,6 @@ from wordcloud import WordCloud
16
15
 
17
16
  from .base_plot import BasePlot
18
17
 
19
- from .utils import _get_axis
20
18
 
21
19
  from .style_template import (
22
20
  FIG_SIZE,
@@ -306,7 +304,7 @@ class WordCloudPlot(BasePlot):
306
304
  max_words=max_words,
307
305
  stopwords=stopwords,
308
306
  )
309
- plot_ax = _get_axis(ax)
307
+ plot_ax = BasePlot.get_axis(ax)
310
308
  return _plot_words(
311
309
  plot_ax,
312
310
  words,
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MatplotLibAPI
3
- Version: 4.0.2
3
+ Version: 4.0.4
4
4
  License-File: LICENSE
5
- Requires-Python: >=3.8
5
+ Requires-Python: >=3.9
6
6
  Requires-Dist: kaleido
7
7
  Requires-Dist: matplotlib
8
8
  Requires-Dist: nbformat
@@ -0,0 +1,35 @@
1
+ MatplotLibAPI/__init__.py,sha256=3eYMzW-R3VbXAWrA6ab6opQNj1LaCsI8qc_ZNfCepzw,188
2
+ MatplotLibAPI/accessor.py,sha256=vjV9mfUz-gJAor-VZ-lZV9auobdX_7fzieA-22YySfM,53722
3
+ MatplotLibAPI/area.py,sha256=nh9Lur1q8FoSGZu_PVaGF1NIzJOcENjp26rG3rRjOWY,5465
4
+ MatplotLibAPI/bar.py,sha256=beDTQ2bMqB0tkDSn_6FfSPHrWS-vLtlhXQfy53vHfIw,4293
5
+ MatplotLibAPI/base_plot.py,sha256=OJXljQRHJFFRtUsETaoBXwJzT1FaRu-u5zmnjx0iU7g,5314
6
+ MatplotLibAPI/box_violin.py,sha256=ivwCYWOhe18PmsWrrZiN3N5wmTDh1TYHSu2Sx6K25tI,3881
7
+ MatplotLibAPI/bubble.py,sha256=AYNnU69M_d3g_w2yEBLyEt1cjzagTvjSnRHtNzQ-u8g,14392
8
+ MatplotLibAPI/composite.py,sha256=X9jVbjzSDEUNYdxMSFdriXujGJoJ5aTMzYb8WX91tbQ,15957
9
+ MatplotLibAPI/heatmap.py,sha256=jF1XyGBhIDx1IjSovXc735SGHyXIrZWkE73aPi2ULfk,7101
10
+ MatplotLibAPI/histogram.py,sha256=DY9OVYV0oblJNDw0D7fWY4GEy3VQN5Lhlik6zI4J5wg,4181
11
+ MatplotLibAPI/mcp_server.py,sha256=hjyW7PipY78rLb5uBU5s9tf3bYRM4GBcR91MzMSX794,19192
12
+ MatplotLibAPI/pie.py,sha256=BznSj2VpHb6gHD9U1WGP8oZmDdHav7JAaRu9fxkkvyw,3498
13
+ MatplotLibAPI/pivot.py,sha256=9rNfPzpskIlZ0rCA-gf3s95KwSKDyKUtUSBs48mvOLo,6615
14
+ MatplotLibAPI/sankey.py,sha256=OtQWzzQP9iPJAWylFnuKnmNFEkjHnzw7zyMQBUl9RIM,3022
15
+ MatplotLibAPI/style_template.py,sha256=AFihe6twpMLYc_4-o0mhEvVMitTRtdAayZB-ECzUSsA,8498
16
+ MatplotLibAPI/sunburst.py,sha256=9UPzov1H9hUHQZ1DtH9pVMjpbeSnnIdRVPpr7majgt8,3767
17
+ MatplotLibAPI/table.py,sha256=qpzJrNe3C0BMCJMB1FQ0oKOfVPkYMPXUUR-Ief5FU3Y,6316
18
+ MatplotLibAPI/timeserie.py,sha256=LVwXcrJRTi-qu070fm4qWYWFHGqiyFgJjY_eTsQ9_nI,11109
19
+ MatplotLibAPI/treemap.py,sha256=7B6-5hogkK4Tr09WPABrcvB47VUf-WGkZUfPpOOmBHo,4952
20
+ MatplotLibAPI/types.py,sha256=eDVmqJ_SPgPNn4aLFIu0lB3eakVT-b09LUKqNZY9sdo,187
21
+ MatplotLibAPI/waffle.py,sha256=jH_b1WRu2a6jGTpujwXtE67YDd6B0CD5zU3FyyQhtWM,4021
22
+ MatplotLibAPI/word_cloud.py,sha256=siRUDIyQuH1ZR-Cg-4QPe58_TVu2aNAjpTpDLK27RKo,13707
23
+ MatplotLibAPI/mcp/__init__.py,sha256=KzF8wOB2dQrAs7i1YMqQWyLnpu0vO8OS7HGyFIGkyoA,434
24
+ MatplotLibAPI/mcp/metadata.py,sha256=G0SJSG4XX5fZQy5F2Ii3FVOM1uprFcBvbGpK7BxMDrg,2880
25
+ MatplotLibAPI/mcp/renderers.py,sha256=mB7B9ytr1ahxkK8MSIFQKtQ3nz5jYmX2JgKhQUe0W4k,1293
26
+ MatplotLibAPI/network/__init__.py,sha256=qkAwW7aQTEORaFB7qcja4rSEpBXy5STveAwhDmV2o2E,784
27
+ MatplotLibAPI/network/constants.py,sha256=857G_-7Gaa1L-8dsdRvWv681TpWfde9ixgrkTdzpY5A,467
28
+ MatplotLibAPI/network/core.py,sha256=4bwUAMuNHD1TTOlQ8XjEmNp7L_jrBZ0KYWfDRbiIfAU,46300
29
+ MatplotLibAPI/network/plot.py,sha256=cPtVC0jiXqj6JJkzpt6Pr7WgRasRnnIbFVFn9itCe6E,23327
30
+ MatplotLibAPI/network/scaling.py,sha256=gdbusWHN-yKYWJjSZ0viqM5S31tZfLH8hojoc2fML2c,1632
31
+ matplotlibapi-4.0.4.dist-info/METADATA,sha256=OE5rn8vXTR20_tFtXcAdjIpImth1yxntQoCvExM55t8,8457
32
+ matplotlibapi-4.0.4.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
33
+ matplotlibapi-4.0.4.dist-info/entry_points.txt,sha256=x_X45-YKZXmwaEiyYqQiPVHFJ5Rj66qwNesDDq3-rWg,68
34
+ matplotlibapi-4.0.4.dist-info/licenses/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
35
+ matplotlibapi-4.0.4.dist-info/RECORD,,
MatplotLibAPI/typing.py DELETED
@@ -1,9 +0,0 @@
1
- """Internal type aliases used across MatplotLibAPI."""
2
-
3
- from typing import Callable, Literal, Sequence, Union
4
-
5
- from typing_extensions import TypeAlias
6
-
7
- # ``DataFrame.corr`` supports the three built-in correlation methods or a callable
8
- # that operates on two array-like inputs and returns a float.
9
- CorrelationMethod: TypeAlias = Literal["pearson", "kendall", "spearman"]
MatplotLibAPI/utils.py DELETED
@@ -1,111 +0,0 @@
1
- """Shared utilities for matplotlib-based plotting helpers."""
2
-
3
- from typing import Any, Callable, Dict, Optional, Tuple, cast
4
-
5
- import matplotlib.pyplot as plt
6
- from numpy import ndarray
7
- from matplotlib.axes import Axes
8
- from matplotlib.figure import Figure
9
- from typing_extensions import Protocol
10
-
11
- from .style_template import StyleTemplate
12
-
13
-
14
- class _AplotFunc(Protocol):
15
- def __call__(self, *, pd_df: Any, ax: Axes, **kwargs: Any) -> Axes: ...
16
-
17
-
18
- def _get_axis(ax: Optional[Axes] = None) -> Axes:
19
- """Return a Matplotlib axes, defaulting to the current one."""
20
- return ax if ax is not None else plt.gca()
21
-
22
-
23
- def _merge_kwargs(
24
- defaults: Dict[str, Any], overrides: Optional[Dict[str, Any]] = None
25
- ) -> Dict[str, Any]:
26
- """Return a merged kwargs dictionary with caller overrides taking precedence.
27
-
28
- Parameters
29
- ----------
30
- defaults : dict[str, Any]
31
- Default keyword arguments.
32
- overrides : dict[str, Any], optional
33
- Caller-provided keyword arguments that should override defaults.
34
-
35
- Returns
36
- -------
37
- dict[str, Any]
38
- Merged keyword arguments.
39
- """
40
- merged = defaults.copy()
41
- if overrides:
42
- merged.update(overrides)
43
- return merged
44
-
45
-
46
- def create_fig(
47
- figsize: Tuple[float, float], style: StyleTemplate
48
- ) -> Tuple[Figure, Axes]:
49
- """Create a styled Matplotlib figure with a single axes.
50
-
51
- Parameters
52
- ----------
53
- figsize : tuple[float, float]
54
- Figure size in inches.
55
- style : StyleTemplate
56
- Style template applied to the figure and axes background.
57
-
58
- Returns
59
- -------
60
- tuple[Figure, Axes]
61
- The newly created figure and subplot axes.
62
- """
63
- fig_raw, ax_raw = plt.subplots(figsize=figsize)
64
- fig = cast(Figure, fig_raw)
65
- ax = cast(Axes, ax_raw)
66
- fig.set_facecolor(style.background_color)
67
- fig.set_edgecolor(style.background_color)
68
- ax.set_facecolor(style.background_color)
69
- return fig, ax
70
-
71
-
72
- def _wrap_aplot(
73
- plot_func: _AplotFunc,
74
- pd_df: Any,
75
- figsize: Tuple[float, float],
76
- style: StyleTemplate,
77
- ax_args: Optional[Dict[str, Any]] = None,
78
- **kwargs: Any,
79
- ) -> Figure:
80
- """Create a new figure and delegate plotting to an axis-level function.
81
-
82
- Parameters
83
- ----------
84
- plot_func : _AplotFunc
85
- Axis-level plotting callable.
86
- pd_df : Any
87
- Data passed to the plotting function.
88
- figsize : tuple[float, float]
89
- Size of the created figure.
90
- ax_args : dict, optional
91
- Additional keyword arguments forwarded to ``plt.subplots``.
92
- **kwargs : Any
93
- Additional arguments forwarded to ``plot_func``.
94
-
95
- Returns
96
- -------
97
- Figure
98
- Figure containing the rendered plot.
99
- """
100
- ax_args = ax_args or {}
101
- fig, axes_obj = plt.subplots(figsize=figsize, **ax_args)
102
- fig_obj: Figure = cast(Figure, fig)
103
- fig_obj.patch.set_facecolor(style.background_color)
104
- ax: Axes
105
- if isinstance(axes_obj, Axes):
106
- ax = axes_obj
107
- else:
108
- ax = cast(Axes, axes_obj.flat[0] if isinstance(axes_obj, ndarray) else axes_obj)
109
- plot_func(pd_df=pd_df, ax=ax, **kwargs)
110
-
111
- return fig_obj
@@ -1,36 +0,0 @@
1
- MatplotLibAPI/__init__.py,sha256=RRT8uq3WQT16lUVs4DgwmL3pCeK6Jo6nOu8LIZFjMH4,200
2
- MatplotLibAPI/accessor.py,sha256=PZ9dpjjN9Zzn6PnbvQkhCkFfKFwPA9Zxhl4SGwSeE94,54908
3
- MatplotLibAPI/area.py,sha256=42gCfJ4vkjAi5GB2GflhPvClTM_0wPDOGyswrNt9Nk4,5497
4
- MatplotLibAPI/bar.py,sha256=JjquQVTIrIHDHzauaaA7TyaC2zcp2IgW7qmHX77l94Q,4313
5
- MatplotLibAPI/base_plot.py,sha256=3rwPk31BNMdd6RqJP5Z4sceKaNJfXzqdXoPxwAyalqg,3482
6
- MatplotLibAPI/box_violin.py,sha256=aewyWQTIoFVBhZBg0c8m9p5iv0b5eGOSOp98qR9RKv8,3909
7
- MatplotLibAPI/bubble.py,sha256=P-9d6O4HRhK7abvxWMmJEMUqzScmH_SIohbO9j37TGY,12833
8
- MatplotLibAPI/composite.py,sha256=UJ4ji6QsQqjVi6Tu1w93FZkr-X1mNHRM5XLPdIK5V9k,9620
9
- MatplotLibAPI/heatmap.py,sha256=K0MnDMcRkuqSop8egAGW_DP283s1ItTNbPfP56KG2yw,7228
10
- MatplotLibAPI/histogram.py,sha256=AxL_2WGP81A-aGtvnJ_gQbUQHGxKdl8HKa4rc4bd2HY,4345
11
- MatplotLibAPI/mcp_server.py,sha256=hjyW7PipY78rLb5uBU5s9tf3bYRM4GBcR91MzMSX794,19192
12
- MatplotLibAPI/pie.py,sha256=wAOosUSYquppCA99-Y6bvId2Ovvlk3ts22tT-kq8hgU,3526
13
- MatplotLibAPI/pivot.py,sha256=YhbfS5tafWCuueSGxR467uOGExObZyeSBmxgXTfBstk,6627
14
- MatplotLibAPI/sankey.py,sha256=OtQWzzQP9iPJAWylFnuKnmNFEkjHnzw7zyMQBUl9RIM,3022
15
- MatplotLibAPI/style_template.py,sha256=AFihe6twpMLYc_4-o0mhEvVMitTRtdAayZB-ECzUSsA,8498
16
- MatplotLibAPI/sunburst.py,sha256=9UPzov1H9hUHQZ1DtH9pVMjpbeSnnIdRVPpr7majgt8,3767
17
- MatplotLibAPI/table.py,sha256=t1P0tOyGX8YSK90lRYlkiE_gZio-pt5uHLJIy_8u0TA,6369
18
- MatplotLibAPI/timeserie.py,sha256=fx2f9T8ocYmD0dtbYTu2_uRulGPz7X1p0R1n3keqbmY,11129
19
- MatplotLibAPI/treemap.py,sha256=7B6-5hogkK4Tr09WPABrcvB47VUf-WGkZUfPpOOmBHo,4952
20
- MatplotLibAPI/typing.py,sha256=MuKNDrlJ8fQRmrhi4gOMlV6eMORZiV15Nx33LpNxVcg,370
21
- MatplotLibAPI/utils.py,sha256=ZcC_Xc5IY4eCUV3NTA2fwjqms70PID2FmRhiHG9Jic4,3107
22
- MatplotLibAPI/waffle.py,sha256=1uv_HcrB1PX4FD6c71ejegWxr8Hkf7yz_-NHIpN6oik,4074
23
- MatplotLibAPI/word_cloud.py,sha256=fUx9WCziQa-OZ2YMC7L5-sXHmwjqWWP4mlwic3_-X5o,13760
24
- MatplotLibAPI/mcp/__init__.py,sha256=KzF8wOB2dQrAs7i1YMqQWyLnpu0vO8OS7HGyFIGkyoA,434
25
- MatplotLibAPI/mcp/metadata.py,sha256=G0SJSG4XX5fZQy5F2Ii3FVOM1uprFcBvbGpK7BxMDrg,2880
26
- MatplotLibAPI/mcp/renderers.py,sha256=mB7B9ytr1ahxkK8MSIFQKtQ3nz5jYmX2JgKhQUe0W4k,1293
27
- MatplotLibAPI/network/__init__.py,sha256=qkAwW7aQTEORaFB7qcja4rSEpBXy5STveAwhDmV2o2E,784
28
- MatplotLibAPI/network/constants.py,sha256=ugU0w1del8XFa-fzHaiKIGXQVhVj4TUyeYEtyDc68JM,466
29
- MatplotLibAPI/network/core.py,sha256=oCFng9tGZfxXKKE_HwN1T_kKMb_JvDl3-2pdq1yNIWo,45580
30
- MatplotLibAPI/network/plot.py,sha256=9ct2Xm8MyUsoZuVt77iFMI8_5b3u6DRD0DbQJt1dPc4,23253
31
- MatplotLibAPI/network/scaling.py,sha256=gdbusWHN-yKYWJjSZ0viqM5S31tZfLH8hojoc2fML2c,1632
32
- matplotlibapi-4.0.2.dist-info/METADATA,sha256=2TU67yODqNkAkcG9zAF6GJS0b7iMYYYSGykA32V0Crw,8457
33
- matplotlibapi-4.0.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
34
- matplotlibapi-4.0.2.dist-info/entry_points.txt,sha256=x_X45-YKZXmwaEiyYqQiPVHFJ5Rj66qwNesDDq3-rWg,68
35
- matplotlibapi-4.0.2.dist-info/licenses/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
36
- matplotlibapi-4.0.2.dist-info/RECORD,,