From f080687b7cdbc0f5047d20ceb0253a3d435d0b16 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Mon, 22 Jul 2024 23:54:56 +0200 Subject: [PATCH] plotly option was not propertly extracted from kwargs (DOH) --- abipy/tools/plotting.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/abipy/tools/plotting.py b/abipy/tools/plotting.py index 9d132f571..224ed0042 100644 --- a/abipy/tools/plotting.py +++ b/abipy/tools/plotting.py @@ -19,7 +19,6 @@ from collections import namedtuple, OrderedDict from typing import Any, Callable, Iterator from monty.string import list_strings -#from pymatgen.util.plotting import add_fig_kwargs from abipy.tools import duck from abipy.tools.iotools import dataframe_from_filepath from abipy.tools.typing import Figure, Axes, VectorLike @@ -87,7 +86,7 @@ def wrapper(*args, **kwargs): ax_grid = kwargs.pop("ax_grid", None) ax_annotate = kwargs.pop("ax_annotate", None) fig_close = kwargs.pop("fig_close", False) - plotly = kwargs.pop("fig_close", False) + plotly = kwargs.pop("plotly", False) # Call func and return immediately if None is returned. fig = func(*args, **kwargs) @@ -129,8 +128,8 @@ def wrapper(*args, **kwargs): if show: plotly_fig.show() return plotly_fig except Exception as exc: - raise - #print(str(exc)) + print("Exception while convertig matplotlib figure to plotly. Returning mpl figure!") + print(str(exc)) pass import matplotlib.pyplot as plt @@ -2752,8 +2751,6 @@ def add_colorscale_dropwdowns(fig): return fig -#TODO: Add plotly option to add_fig_kwargs - def mpl_to_ply(fig: Figure, latex: bool= False): """ Nasty workaround for plotly latex rendering in legend/breaking exception