pandas-plots 0.15.7__py3-none-any.whl → 0.15.9__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 CHANGED
@@ -499,6 +499,11 @@ def plot_stacked_bars(
499
499
  fig.update_xaxes(showgrid=True, gridwidth=1)
500
500
  fig.update_yaxes(showgrid=True, gridwidth=1)
501
501
 
502
+ fig.update_layout(
503
+ width=width,
504
+ height=height,
505
+ )
506
+
502
507
  # * save to png if path is provided
503
508
  if png_path is not None:
504
509
  fig.write_image(Path(png_path).as_posix())
@@ -782,6 +787,11 @@ def plot_bars(
782
787
  textposition="outside",
783
788
  # error_y=dict(thickness=0)
784
789
  )
790
+
791
+ _fig.update_layout(
792
+ width=width,
793
+ height=height,
794
+ )
785
795
 
786
796
  # * set axis title
787
797
  _fig.show(
@@ -881,6 +891,11 @@ def plot_histogram(
881
891
  },
882
892
  showlegend=False if df.shape[1] == 1 else True,
883
893
  )
894
+
895
+ fig.update_layout(
896
+ width=width,
897
+ height=height,
898
+ )
884
899
 
885
900
  fig.show(
886
901
  renderer,
@@ -1142,6 +1157,11 @@ def plot_box(
1142
1157
  y=-0,
1143
1158
  )
1144
1159
 
1160
+ fig.update_layout(
1161
+ width=width,
1162
+ height=height,
1163
+ )
1164
+
1145
1165
  fig.show(
1146
1166
  renderer=renderer or os.getenv("RENDERER"),
1147
1167
  width=width,
@@ -1517,6 +1537,12 @@ def plot_facet_stacked_bars(
1517
1537
  if relative:
1518
1538
  fig.update_yaxes(tickformat=".0%")
1519
1539
 
1540
+ fig.update_layout(
1541
+ width=subplot_size * subplots_per_row,
1542
+ height=subplot_size
1543
+ * (-(-len(aggregated_df["facet"].unique()) // subplots_per_row)),
1544
+ )
1545
+
1520
1546
  if png_path:
1521
1547
  png_path = Path(png_path)
1522
1548
  fig.write_image(str(png_path))
@@ -1859,7 +1885,8 @@ def plot_sankey(
1859
1885
  ]
1860
1886
  )
1861
1887
 
1862
- fig.update_layout(title_text=chart_title, font_size=font_size)
1888
+
1889
+ fig.update_layout(title_text=chart_title, font_size=font_size, width=width, height=height)
1863
1890
  fig.show(renderer=renderer or os.getenv("RENDERER"), width=width, height=height)
1864
1891
 
1865
1892
  # * extend objects to enable chaining
pandas_plots/tbl.py CHANGED
@@ -76,11 +76,11 @@ def describe_df(
76
76
  use_plot: bool = True,
77
77
  use_columns: bool = True,
78
78
  use_missing: bool = False,
79
- renderer: Literal["png", "svg", None] = "png",
79
+ renderer: Literal["png", "svg", None] = None,
80
80
  fig_cols: int = 5,
81
81
  fig_offset: int = None,
82
82
  fig_rowheight: int = 300,
83
- fig_width: int = 400,
83
+ fig_width: int = 300,
84
84
  sort_mode: Literal["value", "index"] = "value",
85
85
  top_n_uniques: int = 5,
86
86
  top_n_chars_in_index: int = 0,
@@ -256,11 +256,18 @@ def describe_df(
256
256
  # * add trace to fig, only data not layout, only 1 series
257
257
  fig.add_trace(figsub["data"][0], row=_row, col=_col)
258
258
 
259
- # * set template
259
+ # * set template and layout size
260
260
  fig.update_layout(
261
- template="plotly_dark" if os.getenv("THEME") == "dark" else "plotly"
261
+ template="plotly_dark" if os.getenv("THEME") == "dark" else "plotly",
262
+ width=fig_width * fig_cols, # <-- Set width here
263
+ height=fig_rowheight * fig_rows, # <-- Set height here
264
+ )
265
+
266
+ fig.show(
267
+ renderer,
268
+ width=fig_width * fig_cols, # <-- Set width here
269
+ height=fig_rowheight * fig_rows, # <-- Set height here
262
270
  )
263
- fig.show(renderer, width=fig_width * fig_cols, height=fig_rowheight * fig_rows)
264
271
 
265
272
  if use_missing:
266
273
  import missingno as msno
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pandas-plots
3
- Version: 0.15.7
3
+ Version: 0.15.9
4
4
  Summary: A collection of helper for table handling and visualization
5
5
  Keywords: tables,pivot,plotly,venn,plot,vizualization
6
6
  Author: smeisegeier
@@ -26,7 +26,7 @@ Requires-Dist: duckdb>=1.3.0
26
26
  Requires-Dist: nbformat>=4.2.0
27
27
  Requires-Dist: dataframe-image>=0.2.6
28
28
  Requires-Dist: connection-helper>=0.12
29
- Requires-Python: >=3.12
29
+ Requires-Python: ~=3.12.0
30
30
  Project-URL: Bug Tracker, https://github.com/smeisegeier/pandas-plots/issues
31
31
  Project-URL: Homepage, https://github.com/smeisegeier/pandas-plots
32
32
  Project-URL: Repository, https://github.com/smeisegeier/pandas-plots
@@ -0,0 +1,9 @@
1
+ pandas_plots/.DS_Store,sha256=e90dd27d76d30869e4b3244fc211ad13e2acf715d00902d8cc1501e123fbf26d,6148
2
+ pandas_plots/__init__.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
3
+ pandas_plots/hlp.py,sha256=cfcaeb54d6c7f6a32885d5cf4fe164b0ff959133a32346c6163e3b4b0e69dda6,21141
4
+ pandas_plots/pls.py,sha256=66afca26f49471609fbb3f870f0d63e12e40be9c14ce83665cd03f69901abe15,65548
5
+ pandas_plots/tbl.py,sha256=489d92b8b4b2664dae89addda1512da8accb5a63e6e2710c58e9507c95a414f1,33571
6
+ pandas_plots/ven.py,sha256=db1dc00a8daf49f3b7aba7eff94743434875489cadf160a1046804e520c27429,11673
7
+ pandas_plots-0.15.9.dist-info/WHEEL,sha256=2b400f346628f0064eb5bbf656b39df8dfcb092437ab08244409d295749b81a3,78
8
+ pandas_plots-0.15.9.dist-info/METADATA,sha256=e2af48eaf0a9b09bd5426312946b3deb61ed8971768ff6898fd5caac05b1f969,8001
9
+ pandas_plots-0.15.9.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.8.8
2
+ Generator: uv 0.8.9
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,9 +0,0 @@
1
- pandas_plots/.DS_Store,sha256=e90dd27d76d30869e4b3244fc211ad13e2acf715d00902d8cc1501e123fbf26d,6148
2
- pandas_plots/__init__.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
3
- pandas_plots/hlp.py,sha256=cfcaeb54d6c7f6a32885d5cf4fe164b0ff959133a32346c6163e3b4b0e69dda6,21141
4
- pandas_plots/pls.py,sha256=33d4f988d959cfb7a8ba0200f3f7a8e4f3d8ab3b9b398af5f76011d43b9e04c2,65031
5
- pandas_plots/tbl.py,sha256=59fb29560173e88549e07b2dd2135486859377933b81d264ce1387c3146d22f7,33332
6
- pandas_plots/ven.py,sha256=db1dc00a8daf49f3b7aba7eff94743434875489cadf160a1046804e520c27429,11673
7
- pandas_plots-0.15.7.dist-info/WHEEL,sha256=93de19be7d53119d6ff54257ff9c5f7ccc85e74dcd153606ae40561b2cc06a21,78
8
- pandas_plots-0.15.7.dist-info/METADATA,sha256=7d5c2431a64026eb49867a663af5ec65d0b24dc05bd39e8e42b7bed5208413af,7999
9
- pandas_plots-0.15.7.dist-info/RECORD,,