Skip to content

Commit

Permalink
fix title arg which was ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
nvaytet committed Sep 20, 2022
1 parent e71f3b5 commit 2b1401b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/plopp/graphics/fig.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def __init__(self,
self._scale = {} if scale is None else scale
self._crop = {} if crop is None else crop
self._cbar = cbar
self._title = title
self._errorbars = errorbars
self._mask_color = mask_color
self._kwargs = kwargs
Expand All @@ -51,14 +50,13 @@ def __init__(self,
if self._ax is None:
if figsize is None:
figsize = (6, 4)
self._fig, self._ax = plt.subplots(1, 1, figsize=figsize
# , dpi=200
)
self._fig, self._ax = plt.subplots(1, 1, figsize=figsize, dpi=96)
self._fig.tight_layout(rect=[0.05, 0.02, 1.0, 1.0])
else:
self._fig = self._ax.get_figure()

self._ax.set_aspect(aspect)
self._ax.set_title(title)
self._ax.grid(grid)
self._legend = 0
self._new_artist = False
Expand Down Expand Up @@ -192,7 +190,7 @@ def _update(self, new_values: DataArray, key: str, draw: bool = True):
self.logy()
self._ax.set_ylabel(
name_with_unit(var=new_values.meta[self._dims['y']['dim']]))
if self._title is None:
if not self._ax.get_title():
self._ax.set_title(new_values.name)

self._ax.set_xlabel(
Expand Down

0 comments on commit 2b1401b

Please sign in to comment.