PY-71958 Plots(fix): Interactive mode in Python Plots show plot of fixed size, ignores figsize

GitOrigin-RevId: 48c072bcbfb6825dce0c0a8ecce5c046a88419d9
This commit is contained in:
Nikita.Ashihmin
2024-06-27 22:40:30 +04:00
committed by intellij-monorepo-bot
parent a1e73fe5a4
commit 7d6b08211f

View File

@@ -101,17 +101,12 @@ class FigureCanvasInterAgg(FigureCanvasAgg):
# mpld3 doesn't support 3D plots
if IS_INTERACTIVE_PLOT and not html_string:
w, h = self.figure.get_figwidth(), self.figure.get_figheight()
self.figure.set_figwidth(DEFAULT_FIGURE_WIDTH)
self.figure.set_figheight(DEFAULT_FIGURE_HEIGHT)
try:
html_string = mpld3.fig_to_html(self.figure)
except:
pass
self.figure.set_figwidth(w)
self.figure.set_figheight(h)
render = self.get_renderer()
width = int(render.width)
debug("Image width: %d" % width)