MatplotLibAPI 3.2.0__py3-none-any.whl → 3.2.1__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/__init__.py CHANGED
@@ -4,7 +4,7 @@ from .Bubble import plot_bubble, BUBBLE_STYLE_TEMPLATE
4
4
  from .Composite import plot_composite_bubble
5
5
  from .Timeserie import plot_timeserie, TIMESERIE_STYLE_TEMPLATE
6
6
  from .Table import plot_table, TABLE_STYLE_TEMPLATE
7
- from .Network import Graph
7
+ from .Network import plot_network, plot_network_components, NETWORK_STYLE_TEMPLATE
8
8
  from .Treemap import plot_treemap, TREEMAP_STYLE_TEMPLATE
9
9
  from typing import List, Optional
10
10
  import pandas as pd
@@ -15,9 +15,6 @@ from matplotlib.figure import Figure
15
15
  import plotly.graph_objects as go
16
16
 
17
17
 
18
-
19
-
20
-
21
18
  @register_dataframe_accessor("mpl")
22
19
  class DataFrameAccessor:
23
20
 
@@ -34,7 +31,8 @@ class DataFrameAccessor:
34
31
  max_values: int = 50,
35
32
  center_to_mean: bool = False,
36
33
  sort_by: Optional[str] = None,
37
- ascending: bool = False) -> Axes:
34
+ ascending: bool = False,
35
+ ax: Optional[Axes] = None) -> Axes:
38
36
 
39
37
  return plot_bubble(pd_df=self._obj,
40
38
  label=label,
@@ -46,7 +44,8 @@ class DataFrameAccessor:
46
44
  max_values=max_values,
47
45
  center_to_mean=center_to_mean,
48
46
  sort_by=sort_by,
49
- ascending=ascending)
47
+ ascending=ascending,
48
+ ax=ax)
50
49
 
51
50
  def plot_composite_bubble(self,
52
51
  label: str,
@@ -58,7 +57,8 @@ class DataFrameAccessor:
58
57
  max_values: int = 100,
59
58
  center_to_mean: bool = False,
60
59
  sort_by: Optional[str] = None,
61
- ascending: bool = False) -> Figure:
60
+ ascending: bool = False,
61
+ ax: Optional[Axes] = None) -> Figure:
62
62
 
63
63
  return plot_composite_bubble(pd_df=self._obj,
64
64
  label=label,
@@ -70,7 +70,8 @@ class DataFrameAccessor:
70
70
  max_values=max_values,
71
71
  center_to_mean=center_to_mean,
72
72
  sort_by=sort_by,
73
- ascending=ascending)
73
+ ascending=ascending,
74
+ ax=ax)
74
75
 
75
76
  def plot_table(self,
76
77
  cols: List[str],
@@ -78,7 +79,8 @@ class DataFrameAccessor:
78
79
  style: StyleTemplate = TABLE_STYLE_TEMPLATE,
79
80
  max_values: int = 20,
80
81
  sort_by: Optional[str] = None,
81
- ascending: bool = False) -> Axes:
82
+ ascending: bool = False,
83
+ ax: Optional[Axes] = None) -> Axes:
82
84
 
83
85
  return plot_table(pd_df=self._obj,
84
86
  cols=cols,
@@ -86,7 +88,8 @@ class DataFrameAccessor:
86
88
  style=style,
87
89
  max_values=max_values,
88
90
  sort_by=sort_by,
89
- ascending=ascending)
91
+ ascending=ascending,
92
+ ax=ax)
90
93
 
91
94
  def plot_timeserie(self,
92
95
  label: str,
@@ -96,7 +99,8 @@ class DataFrameAccessor:
96
99
  style: StyleTemplate = TIMESERIE_STYLE_TEMPLATE,
97
100
  max_values: int = 100,
98
101
  sort_by: Optional[str] = None,
99
- ascending: bool = False) -> Axes:
102
+ ascending: bool = False,
103
+ ax: Optional[Axes] = None) -> Axes:
100
104
 
101
105
  return plot_timeserie(pd_df=self._obj,
102
106
  label=label,
@@ -106,24 +110,52 @@ class DataFrameAccessor:
106
110
  style=style,
107
111
  max_values=max_values,
108
112
  sort_by=sort_by,
109
- ascending=ascending)
113
+ ascending=ascending,
114
+ ax=ax)
110
115
 
111
116
  def plot_network(self,
112
117
  source: str = "source",
113
118
  target: str = "target",
114
119
  weight: str = "weight",
115
120
  title: Optional[str] = None,
116
- style: StyleTemplate = TIMESERIE_STYLE_TEMPLATE,
117
- max_values: int = 20,
121
+ style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
118
122
  sort_by: Optional[str] = None,
119
- ascending: bool = False) -> Axes:
120
-
121
- graph = Graph.from_pandas_edgelist(df=self._obj,
122
- source=source,
123
- target=target,
124
- weight=weight)
125
-
126
- return graph.plotX(title, style)
123
+ ascending: bool = False,
124
+ node_list: Optional[List] = None,
125
+ ax: Optional[Axes] = None) -> Axes:
126
+
127
+ return plot_network(df=self._obj,
128
+ source=source,
129
+ target=target,
130
+ weight=weight,
131
+ title=title,
132
+ style=style,
133
+ sort_by=sort_by,
134
+ ascending=ascending,
135
+ node_list=node_list,
136
+ ax=ax)
137
+
138
+ def plot_network_components(self,
139
+ source: str = "source",
140
+ target: str = "target",
141
+ weight: str = "weight",
142
+ title: Optional[str] = None,
143
+ style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
144
+ sort_by: Optional[str] = None,
145
+ ascending: bool = False,
146
+ node_list: Optional[List] = None,
147
+ ax: Optional[Axes] = None) -> Axes:
148
+
149
+ return plot_network_components(df=self._obj,
150
+ source=source,
151
+ target=target,
152
+ weight=weight,
153
+ title=title,
154
+ style=style,
155
+ sort_by=sort_by,
156
+ ascending=ascending,
157
+ node_list=node_list,
158
+ ax=ax)
127
159
 
128
160
  def plot_treemap(self,
129
161
  path: str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MatplotLibAPI
3
- Version: 3.2.0
3
+ Version: 3.2.1
4
4
  Requires-Python: >=3.7
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -6,9 +6,9 @@ MatplotLibAPI/StyleTemplate.py,sha256=va8_yXaun1RnjQUOEHGvsXJrKWHdzz4BhnY0CkROLW
6
6
  MatplotLibAPI/Table.py,sha256=4vgvF2pXjewd23-a7KyuLQs-Hohnv69VK1_uRPgGi_o,2005
7
7
  MatplotLibAPI/Timeserie.py,sha256=cqPONNvDmJ_7UmkOBVpBbD9oEgS79SbhEVlf1qZ3kW0,3446
8
8
  MatplotLibAPI/Treemap.py,sha256=ELkmcNZuWh-thd4gKwqkSQTisnBDutHHgxGuH1ZBzsg,2552
9
- MatplotLibAPI/__init__.py,sha256=eV05b2Le25jR0goOWBdch15tvE5H_pngljzl-CRMv_s,5931
10
- MatplotLibAPI-3.2.0.dist-info/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
11
- MatplotLibAPI-3.2.0.dist-info/METADATA,sha256=l_p7icLMmoE7FLK7xRUMYYDqxrqoFMK6e7W8A5cYzUw,462
12
- MatplotLibAPI-3.2.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
13
- MatplotLibAPI-3.2.0.dist-info/top_level.txt,sha256=MrzbBjDEW48Vb6YhQIqpFYGOhHzQnEIM5Qy2xy2iqew,14
14
- MatplotLibAPI-3.2.0.dist-info/RECORD,,
9
+ MatplotLibAPI/__init__.py,sha256=O1b1kutZ_E8pUx4lkQTM2OXjZQIWQ8X7CUPScHRq5dI,7691
10
+ MatplotLibAPI-3.2.1.dist-info/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
11
+ MatplotLibAPI-3.2.1.dist-info/METADATA,sha256=6fvA8pdZp_AWIDUNVBEm1vwhCkNUQ01XP3WYiJbMgUg,462
12
+ MatplotLibAPI-3.2.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
13
+ MatplotLibAPI-3.2.1.dist-info/top_level.txt,sha256=MrzbBjDEW48Vb6YhQIqpFYGOhHzQnEIM5Qy2xy2iqew,14
14
+ MatplotLibAPI-3.2.1.dist-info/RECORD,,