Skip to content

Commit

Permalink
Fix clabel fallback when using custom plot_meta
Browse files Browse the repository at this point in the history
  • Loading branch information
siiptuo committed Apr 5, 2024
1 parent 97a7bc9 commit 9697295
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cloudnetpy/plotting/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,11 @@ def show_footer(self, fig: Figure, ax: Axes) -> None:

def _read_plot_meta(self, file_type: str | None) -> PlotMeta:
if self.options.plot_meta is not None:
return self.options.plot_meta
fallback = ATTRIBUTES["fallback"].get(self.variable.name, PlotMeta())
file_attributes = ATTRIBUTES.get(file_type or "", {})
plot_meta = file_attributes.get(self.variable.name, fallback)
plot_meta = self.options.plot_meta
else:
fallback = ATTRIBUTES["fallback"].get(self.variable.name, PlotMeta())
file_attributes = ATTRIBUTES.get(file_type or "", {})
plot_meta = file_attributes.get(self.variable.name, fallback)
if plot_meta.clabel is None:
plot_meta = plot_meta._replace(clabel=_reformat_units(self.variable.units))
return plot_meta
Expand Down

0 comments on commit 9697295

Please sign in to comment.