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

Function set_size

tests/plot.py:136–146  ·  view source on GitHub ↗

w, h: width, height in inches

(w: int, h: int, ax: Any)

Source from the content-addressed store, hash-verified

134
135
136def set_size(w: int, h: int, ax: Any) -> None:
137 """w, h: width, height in inches"""
138 if not ax:
139 ax = plt.gca()
140 left = ax.figure.subplotpars.left
141 right = ax.figure.subplotpars.right
142 top = ax.figure.subplotpars.top
143 bottom = ax.figure.subplotpars.bottom
144 figw = float(w) / (right - left)
145 figh = float(h) / (top - bottom)
146 ax.figure.set_size_inches(figw, figh)
147
148
149def apply_to_graphs(ax: Any, legend: bool, width: float) -> Any:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected