Skip to content

Commit

Permalink
plotly option was not propertly extracted from kwargs (DOH)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmatteo committed Jul 22, 2024
1 parent 37860f9 commit f080687
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions abipy/tools/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f080687

Please sign in to comment.