Skip to content

Commit

Permalink
Remove title from colorbar (#260)
Browse files Browse the repository at this point in the history
And add units to its label instead
  • Loading branch information
dnerini committed Jan 27, 2022
1 parent 10540d2 commit 6752bad
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pysteps/visualization/precipfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,11 @@ def plot_precip_field(
cbar.ax.set_yticklabels(clevs_str)

if ptype == "intensity":
cbar.ax.set_title(units, fontsize=10)
cbar.set_label("Precipitation intensity")
cbar.set_label(f"Precipitation intensity [{units}]")
elif ptype == "depth":
cbar.ax.set_title(units, fontsize=10)
cbar.set_label("Precipitation depth")
cbar.set_label(f"Precipitation depth [{units}]")
else:
cbar.set_label("P(R > %.1f %s)" % (probthr, units))
cbar.set_label(f"P(R > {probthr:.1f} {units})")

if geodata is None or axis == "off":
ax.xaxis.set_ticks([])
Expand Down

0 comments on commit 6752bad

Please sign in to comment.