MCPcopy Create free account
hub / github.com/Mic92/vmsh / rescale_barplot_width

Function rescale_barplot_width

tests/plot.py:93–99  ·  view source on GitHub ↗
(ax: Any, factor: float = 0.6)

Source from the content-addressed store, hash-verified

91
92
93def rescale_barplot_width(ax: Any, factor: float = 0.6) -> None:
94 for bar in ax.patches:
95 x = bar.get_x()
96 new_width = bar.get_width() * factor
97 center = x + bar.get_width() / 2.0
98 bar.set_width(new_width)
99 bar.set_x(center - new_width / 2.0)
100
101
102def column_alias(name: str) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected