Skip to content

Commit

Permalink
add watermark
Browse files Browse the repository at this point in the history
  • Loading branch information
jwarner8 committed Aug 19, 2024
1 parent b4d4bbd commit 5868ce6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/CSET/operators/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,24 @@ def _plot_and_save_contour_plot(
# Add title.
axes.set_title(title, fontsize=16)

# Add watermark with min/max/mean. Currently not user toggable.
axes.annotate(
"Min:"
+ str(round(np.min(cube.data), 1))
+ " Max:"
+ str(round(np.max(cube.data), 1))
+ " Mean:"
+ str(round(np.mean(cube.data), 1)),
xy=(1, 0),
xycoords="axes fraction",
xytext=(-5, 5),
textcoords="offset points",
ha="right",
va="bottom",
size=11,
bbox=dict(boxstyle="round", fc="0.8", ec="0.5", alpha=0.9),
)

# Add colour bar.
cbar = fig.colorbar(contours)
cbar.set_label(label=f"{cube.name()} ({cube.units})", size=20)
Expand Down

0 comments on commit 5868ce6

Please sign in to comment.