MCPcopy Index your code
hub / github.com/plotly/plotly.py / resize

Method resize

plotly/matplotlylib/renderer.py:801–815  ·  view source on GitHub ↗

Revert figure layout to allow plotly to resize. By default, PlotlyRenderer tries its hardest to precisely mimic an mpl figure. However, plotly is pretty good with aesthetics. By running PlotlyRenderer.resize(), layout parameters are deleted. This lets plotly choose t

(self)

Source from the content-addressed store, hash-verified

799 self.plotly_fig["layout"][axis_key]["title_font"] = title_font
800
801 def resize(self):
802 """Revert figure layout to allow plotly to resize.
803
804 By default, PlotlyRenderer tries its hardest to precisely mimic an
805 mpl figure. However, plotly is pretty good with aesthetics. By
806 running PlotlyRenderer.resize(), layout parameters are deleted. This
807 lets plotly choose them instead of mpl.
808
809 """
810 self.msg += "Resizing figure, deleting keys from layout\n"
811 for key in ["width", "height", "autosize", "margin"]:
812 try:
813 del self.plotly_fig["layout"][key]
814 except (KeyError, AttributeError):
815 pass
816
817 def strip_style(self):
818 self.msg += "Stripping mpl style is no longer supported\n"

Callers 1

mpl_to_plotlyFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected