pandas-plots 0.12.3__tar.gz → 0.12.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pandas-plots
3
- Version: 0.12.3
3
+ Version: 0.12.4
4
4
  Summary: A collection of helper for table handling and visualization
5
5
  Home-page: https://github.com/smeisegeier/pandas-plots
6
6
  Author: smeisegeier
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = pandas-plots
3
- version = 0.12.3
3
+ version = 0.12.4
4
4
  author = smeisegeier
5
5
  author_email = dexterDSDo@googlemail.com
6
6
  description = A collection of helper for table handling and visualization
@@ -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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pandas-plots
3
- Version: 0.12.3
3
+ Version: 0.12.4
4
4
  Summary: A collection of helper for table handling and visualization
5
5
  Home-page: https://github.com/smeisegeier/pandas-plots
6
6
  Author: smeisegeier
File without changes
File without changes