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)
| 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" |