MatplotLibAPI 3.2.21__py3-none-any.whl → 4.0.0__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.
Files changed (51) hide show
  1. MatplotLibAPI/__init__.py +4 -86
  2. MatplotLibAPI/accessor.py +519 -196
  3. MatplotLibAPI/area.py +177 -0
  4. MatplotLibAPI/bar.py +185 -0
  5. MatplotLibAPI/base_plot.py +88 -0
  6. MatplotLibAPI/box_violin.py +180 -0
  7. MatplotLibAPI/bubble.py +568 -0
  8. MatplotLibAPI/{Composite.py → composite.py} +127 -106
  9. MatplotLibAPI/heatmap.py +223 -0
  10. MatplotLibAPI/histogram.py +170 -0
  11. MatplotLibAPI/mcp/__init__.py +17 -0
  12. MatplotLibAPI/mcp/metadata.py +90 -0
  13. MatplotLibAPI/mcp/renderers.py +45 -0
  14. MatplotLibAPI/mcp_server.py +626 -0
  15. MatplotLibAPI/network/__init__.py +28 -0
  16. MatplotLibAPI/network/constants.py +22 -0
  17. MatplotLibAPI/network/core.py +1360 -0
  18. MatplotLibAPI/network/plot.py +597 -0
  19. MatplotLibAPI/network/scaling.py +56 -0
  20. MatplotLibAPI/pie.py +154 -0
  21. MatplotLibAPI/pivot.py +274 -0
  22. MatplotLibAPI/sankey.py +99 -0
  23. MatplotLibAPI/{StyleTemplate.py → style_template.py} +27 -22
  24. MatplotLibAPI/sunburst.py +139 -0
  25. MatplotLibAPI/{Table.py → table.py} +112 -87
  26. MatplotLibAPI/{Timeserie.py → timeserie.py} +98 -42
  27. MatplotLibAPI/{Treemap.py → treemap.py} +43 -55
  28. MatplotLibAPI/typing.py +12 -0
  29. MatplotLibAPI/{_visualization_utils.py → utils.py} +7 -13
  30. MatplotLibAPI/waffle.py +173 -0
  31. MatplotLibAPI/word_cloud.py +489 -0
  32. {matplotlibapi-3.2.21.dist-info → matplotlibapi-4.0.0.dist-info}/METADATA +98 -9
  33. matplotlibapi-4.0.0.dist-info/RECORD +36 -0
  34. {matplotlibapi-3.2.21.dist-info → matplotlibapi-4.0.0.dist-info}/WHEEL +1 -1
  35. matplotlibapi-4.0.0.dist-info/entry_points.txt +2 -0
  36. MatplotLibAPI/Area.py +0 -80
  37. MatplotLibAPI/Bar.py +0 -83
  38. MatplotLibAPI/BoxViolin.py +0 -75
  39. MatplotLibAPI/Bubble.py +0 -458
  40. MatplotLibAPI/Heatmap.py +0 -121
  41. MatplotLibAPI/Histogram.py +0 -73
  42. MatplotLibAPI/Network.py +0 -989
  43. MatplotLibAPI/Pie.py +0 -70
  44. MatplotLibAPI/Pivot.py +0 -134
  45. MatplotLibAPI/Sankey.py +0 -46
  46. MatplotLibAPI/Sunburst.py +0 -89
  47. MatplotLibAPI/Waffle.py +0 -86
  48. MatplotLibAPI/Wordcloud.py +0 -373
  49. MatplotLibAPI/_typing.py +0 -17
  50. matplotlibapi-3.2.21.dist-info/RECORD +0 -26
  51. {matplotlibapi-3.2.21.dist-info → matplotlibapi-4.0.0.dist-info}/licenses/LICENSE +0 -0
MatplotLibAPI/Heatmap.py DELETED
@@ -1,121 +0,0 @@
1
- """Heatmap and correlation matrix helpers."""
2
-
3
- from typing import Any, Dict, Optional, Sequence, Tuple
4
-
5
- import numpy as np
6
- import pandas as pd
7
- import seaborn as sns
8
- from matplotlib.axes import Axes
9
- from matplotlib.figure import Figure
10
-
11
- from .StyleTemplate import (
12
- HEATMAP_STYLE_TEMPLATE,
13
- StyleTemplate,
14
- string_formatter,
15
- validate_dataframe,
16
- )
17
- from ._visualization_utils import _get_axis, _wrap_aplot
18
- from ._typing import CorrelationMethod
19
-
20
-
21
- def aplot_heatmap(
22
- pd_df: pd.DataFrame,
23
- x: str,
24
- y: str,
25
- value: str,
26
- title: Optional[str] = None,
27
- style: StyleTemplate = HEATMAP_STYLE_TEMPLATE,
28
- ax: Optional[Axes] = None,
29
- **kwargs: Any,
30
- ) -> Axes:
31
- """Plot a matrix heatmap for multivariate pattern detection."""
32
- validate_dataframe(pd_df, cols=[x, y, value])
33
- plot_ax = _get_axis(ax)
34
-
35
- pivot_df = pd_df.pivot_table(index=y, columns=x, values=value, aggfunc="mean")
36
- sns.heatmap(pivot_df, cmap=style.palette, ax=plot_ax)
37
-
38
- plot_ax.set_xlabel(string_formatter(x))
39
- plot_ax.set_ylabel(string_formatter(y))
40
- if title:
41
- plot_ax.set_title(title)
42
- return plot_ax
43
-
44
-
45
- def aplot_correlation_matrix(
46
- pd_df: pd.DataFrame,
47
- columns: Optional[Sequence[str]] = None,
48
- method: CorrelationMethod = "pearson",
49
- title: Optional[str] = None,
50
- style: StyleTemplate = HEATMAP_STYLE_TEMPLATE,
51
- ax: Optional[Axes] = None,
52
- **kwargs: Any,
53
- ) -> Axes:
54
- """Plot a correlation matrix heatmap for numeric columns."""
55
- subset = (
56
- columns
57
- if columns is not None
58
- else pd_df.select_dtypes(include=[np.number]).columns
59
- )
60
- if len(subset) == 0:
61
- raise AttributeError("No numeric columns available for correlation matrix")
62
-
63
- validate_dataframe(pd_df, cols=list(subset))
64
- plot_ax = _get_axis(ax)
65
-
66
- selected: pd.DataFrame = pd_df.loc[:, list(subset)]
67
- corr = selected.corr(method=method)
68
- sns.heatmap(corr, cmap=style.palette, annot=True, fmt=".2f", ax=plot_ax)
69
- if title:
70
- plot_ax.set_title(title)
71
- return plot_ax
72
-
73
-
74
- def fplot_heatmap(
75
- pd_df: pd.DataFrame,
76
- x: str,
77
- y: str,
78
- value: str,
79
- title: Optional[str] = None,
80
- style: StyleTemplate = HEATMAP_STYLE_TEMPLATE,
81
- figsize: Tuple[float, float] = (10, 6),
82
- save_path: Optional[str] = None,
83
- savefig_kwargs: Optional[Dict[str, Any]] = None,
84
- ) -> Figure:
85
- """Plot a matrix heatmap on a new figure."""
86
- return _wrap_aplot(
87
- aplot_heatmap,
88
- pd_df=pd_df,
89
- figsize=figsize,
90
- x=x,
91
- y=y,
92
- value=value,
93
- title=title,
94
- style=style,
95
- save_path=save_path,
96
- savefig_kwargs=savefig_kwargs,
97
- )
98
-
99
-
100
- def fplot_correlation_matrix(
101
- pd_df: pd.DataFrame,
102
- columns: Optional[Sequence[str]] = None,
103
- method: CorrelationMethod = "pearson",
104
- title: Optional[str] = None,
105
- style: StyleTemplate = HEATMAP_STYLE_TEMPLATE,
106
- figsize: Tuple[float, float] = (10, 6),
107
- save_path: Optional[str] = None,
108
- savefig_kwargs: Optional[Dict[str, Any]] = None,
109
- ) -> Figure:
110
- """Plot a correlation matrix heatmap on a new figure."""
111
- return _wrap_aplot(
112
- aplot_correlation_matrix,
113
- pd_df=pd_df,
114
- figsize=figsize,
115
- columns=columns,
116
- method=method,
117
- title=title,
118
- style=style,
119
- save_path=save_path,
120
- savefig_kwargs=savefig_kwargs,
121
- )
@@ -1,73 +0,0 @@
1
- """Histogram and KDE plotting helpers."""
2
-
3
- from typing import Any, Dict, Optional, Tuple
4
-
5
- import pandas as pd
6
- import seaborn as sns
7
- from matplotlib.axes import Axes
8
- from matplotlib.figure import Figure
9
-
10
- from .StyleTemplate import (
11
- DISTRIBUTION_STYLE_TEMPLATE,
12
- StyleTemplate,
13
- string_formatter,
14
- validate_dataframe,
15
- )
16
- from ._visualization_utils import _get_axis, _wrap_aplot
17
-
18
-
19
- def aplot_histogram_kde(
20
- pd_df: pd.DataFrame,
21
- column: str,
22
- bins: int = 20,
23
- kde: bool = True,
24
- title: Optional[str] = None,
25
- style: StyleTemplate = DISTRIBUTION_STYLE_TEMPLATE,
26
- ax: Optional[Axes] = None,
27
- **kwargs: Any,
28
- ) -> Axes:
29
- """Plot a histogram with an optional kernel density estimate."""
30
- validate_dataframe(pd_df, cols=[column])
31
- plot_ax = _get_axis(ax)
32
-
33
- sns.histplot(
34
- data=pd_df,
35
- x=column,
36
- bins=bins,
37
- kde=kde,
38
- color=style.font_color,
39
- edgecolor=style.background_color,
40
- ax=plot_ax,
41
- )
42
- plot_ax.set_facecolor(style.background_color)
43
- plot_ax.set_xlabel(string_formatter(column))
44
- plot_ax.set_ylabel("Frequency")
45
- if title:
46
- plot_ax.set_title(title)
47
- return plot_ax
48
-
49
-
50
- def fplot_histogram_kde(
51
- pd_df: pd.DataFrame,
52
- column: str,
53
- bins: int = 20,
54
- kde: bool = True,
55
- title: Optional[str] = None,
56
- style: StyleTemplate = DISTRIBUTION_STYLE_TEMPLATE,
57
- figsize: Tuple[float, float] = (10, 6),
58
- save_path: Optional[str] = None,
59
- savefig_kwargs: Optional[Dict[str, Any]] = None,
60
- ) -> Figure:
61
- """Plot a histogram with optional KDE on a new figure."""
62
- return _wrap_aplot(
63
- aplot_histogram_kde,
64
- pd_df=pd_df,
65
- figsize=figsize,
66
- column=column,
67
- bins=bins,
68
- kde=kde,
69
- title=title,
70
- style=style,
71
- save_path=save_path,
72
- savefig_kwargs=savefig_kwargs,
73
- )