pandas-plots 0.12.3__py3-none-any.whl → 0.12.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.
- pandas_plots/pls.py +38 -0
- {pandas_plots-0.12.3.dist-info → pandas_plots-0.12.4.dist-info}/METADATA +1 -1
- pandas_plots-0.12.4.dist-info/RECORD +10 -0
- pandas_plots-0.12.3.dist-info/RECORD +0 -10
- {pandas_plots-0.12.3.dist-info → pandas_plots-0.12.4.dist-info}/LICENSE +0 -0
- {pandas_plots-0.12.3.dist-info → pandas_plots-0.12.4.dist-info}/WHEEL +0 -0
- {pandas_plots-0.12.3.dist-info → pandas_plots-0.12.4.dist-info}/top_level.txt +0 -0
pandas_plots/pls.py
CHANGED
@@ -278,6 +278,44 @@ def plot_stacked_bars(
|
|
278
278
|
height=height,
|
279
279
|
color_discrete_map=column_colors, # Use assigned colors
|
280
280
|
)
|
281
|
+
# * get longest bar
|
282
|
+
bar_max = (
|
283
|
+
df.groupby(col_index)[df.columns[2]].sum().sort_values(ascending=False).iloc[0]
|
284
|
+
* BAR_LENGTH_MULTIPLIER
|
285
|
+
)
|
286
|
+
# * ignore if bar mode is on
|
287
|
+
if not relative:
|
288
|
+
if orientation == "v":
|
289
|
+
_fig.update_yaxes(range=[0, bar_max])
|
290
|
+
else:
|
291
|
+
_fig.update_xaxes(range=[0, bar_max])
|
292
|
+
else:
|
293
|
+
_fig.update_layout(barnorm="percent")
|
294
|
+
|
295
|
+
# * set title properties
|
296
|
+
_fig.update_layout(
|
297
|
+
title={
|
298
|
+
# 'x': 0.1,
|
299
|
+
"y": 0.95,
|
300
|
+
"xanchor": "left",
|
301
|
+
"yanchor": "top",
|
302
|
+
"font": {
|
303
|
+
"size": 24,
|
304
|
+
},
|
305
|
+
},
|
306
|
+
)
|
307
|
+
|
308
|
+
# * set dtick
|
309
|
+
if orientation == "h":
|
310
|
+
if relative:
|
311
|
+
_fig.update_xaxes(dtick=5)
|
312
|
+
elif normalize:
|
313
|
+
_fig.update_xaxes(dtick=0.05)
|
314
|
+
else:
|
315
|
+
if relative:
|
316
|
+
_fig.update_yaxes(dtick=5)
|
317
|
+
elif normalize:
|
318
|
+
_fig.update_yaxes(dtick=0.05)
|
281
319
|
|
282
320
|
# * show grids, set to smaller distance on pct scale
|
283
321
|
_fig.update_xaxes(showgrid=True, gridwidth=1)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
pandas_plots/hlp.py,sha256=N6NrbFagVMMX-ZnV0rIBEz82SeSoOkksfMcCap55W7E,16588
|
2
|
+
pandas_plots/pii.py,sha256=2WKE-W9s285jPdsTqCgt1uxuW4lj1PYCVOYB2fYDNwQ,2195
|
3
|
+
pandas_plots/pls.py,sha256=isveg6_frLZC3Gt3VEsdOLiLw7aTf3riUahmJLHiEq8,40265
|
4
|
+
pandas_plots/tbl.py,sha256=4VvjLisPT1gSvgsLClcrhC7LIJ-_FPNla8nomGflGag,30509
|
5
|
+
pandas_plots/ven.py,sha256=2x3ACo2vSfO3q6fv-UdDQ0h1SJyt8WChBGgE5SDCdCk,11673
|
6
|
+
pandas_plots-0.12.4.dist-info/LICENSE,sha256=6KQ5KVAAhRaB-JJKpX4cefKvRZRgI7GUPc92_2d31XY,1051
|
7
|
+
pandas_plots-0.12.4.dist-info/METADATA,sha256=WZUfWOid_eYMtuS2V_P_C_ChaD1dTqDfuectlxzAJe8,7358
|
8
|
+
pandas_plots-0.12.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
9
|
+
pandas_plots-0.12.4.dist-info/top_level.txt,sha256=XnaNuIHBqMmCeh_U7nKOYTwFue_SIA0wxuDgdPmnnSk,13
|
10
|
+
pandas_plots-0.12.4.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
pandas_plots/hlp.py,sha256=N6NrbFagVMMX-ZnV0rIBEz82SeSoOkksfMcCap55W7E,16588
|
2
|
-
pandas_plots/pii.py,sha256=2WKE-W9s285jPdsTqCgt1uxuW4lj1PYCVOYB2fYDNwQ,2195
|
3
|
-
pandas_plots/pls.py,sha256=nNpAPIxONcoUb_E6U6oGEEjva6MFgycc3pBq0fb1TQ0,39268
|
4
|
-
pandas_plots/tbl.py,sha256=4VvjLisPT1gSvgsLClcrhC7LIJ-_FPNla8nomGflGag,30509
|
5
|
-
pandas_plots/ven.py,sha256=2x3ACo2vSfO3q6fv-UdDQ0h1SJyt8WChBGgE5SDCdCk,11673
|
6
|
-
pandas_plots-0.12.3.dist-info/LICENSE,sha256=6KQ5KVAAhRaB-JJKpX4cefKvRZRgI7GUPc92_2d31XY,1051
|
7
|
-
pandas_plots-0.12.3.dist-info/METADATA,sha256=B_W5POVonGswuIrADMZGWiKNVuwWkXBKQN9CQj8-wP8,7358
|
8
|
-
pandas_plots-0.12.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
9
|
-
pandas_plots-0.12.3.dist-info/top_level.txt,sha256=XnaNuIHBqMmCeh_U7nKOYTwFue_SIA0wxuDgdPmnnSk,13
|
10
|
-
pandas_plots-0.12.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|