Skip to content

Commit

Permalink
Change difference plot colorbar to scientific notation (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdturner authored Aug 21, 2020
1 parent eb77517 commit e5ff1f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion configuration/scripts/tests/QC/cice.t-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,12 @@ def plot_data(data, lat, lon, units, case, plot_type):
# Make some room at the bottom of the figure, and create a colorbar
fig.subplots_adjust(bottom=0.2)
cbar_ax = fig.add_axes([0.11,0.1,0.8,0.05])
cb = plt.colorbar(sc, cax=cbar_ax, orientation="horizontal", format="%.2f")
if '\n- ' in case:
# If making a difference plot, use scientific notation for colorbar
cb = plt.colorbar(sc, cax=cbar_ax, orientation="horizontal", format="%.2e")
else:
# If plotting non-difference data, do not use scientific notation for colorbar
cb = plt.colorbar(sc, cax=cbar_ax, orientation="horizontal", format="%.2f")
cb.set_label(units, x=1.0)

outfile = 'ice_thickness_{}.png'.format(case.replace('\n- ','_minus_'))
Expand Down

0 comments on commit e5ff1f2

Please sign in to comment.