Skip to content

Commit

Permalink
refactor: improve initial import time
Browse files Browse the repository at this point in the history
  • Loading branch information
kmnhan committed Aug 7, 2024
1 parent a985742 commit f720973
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/erlab/accessors/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import numpy as np
import xarray as xr

import erlab.plotting.erplot as eplt
from erlab.accessors.utils import (
ERLabDataArrayAccessor,
ERLabDatasetAccessor,
Expand All @@ -42,16 +41,18 @@ def __call__(self, *args, **kwargs):
Keyword arguments to be passed to the plotting function.
"""
from erlab.plotting.erplot import fancy_labels, plot_array

if len(self._obj.dims) == 2:
return eplt.plot_array(self._obj, *args, **kwargs)
return plot_array(self._obj, *args, **kwargs)

ax = kwargs.pop("ax", None)
if ax is None:
ax = plt.gca()
kwargs["ax"] = ax

out = self._obj.plot(*args, **kwargs)
eplt.fancy_labels(ax)
fancy_labels(ax)
return out


Expand Down
2 changes: 1 addition & 1 deletion src/erlab/plotting/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ def mark_points_outside(
If ``'x'``, marks points along the horizontal axis. If ``'y'``, marks points
along the vertical axis.
roman
If ``False``, *True*, itallic fonts are used.
If ``False``, itallic fonts are used.
bar
If ``True``, prints a bar over the label.
ax
Expand Down

0 comments on commit f720973

Please sign in to comment.