Fix matplotlib to plotly conversion fails on subplots (convert as image if figure has subplots)

This commit is contained in:
allegroai 2022-04-13 14:18:50 +03:00
parent 7625de3f2f
commit 15574aa7e2

View File

@ -375,6 +375,11 @@ class PatchedMatplotlib:
if PatchedMatplotlib._force_report_as_image:
force_save_as_image = True
# if we have subplots, we will probably fail in conversion, so we just store as image
if not report_as_debug_sample and not force_save_as_image and \
mpl_fig and getattr(mpl_fig, 'axes', None) and len(mpl_fig.axes) > 1:
force_save_as_image = True
# convert to plotly
image = None
plotly_dict = None