Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
CLIMATE-472 - Fix overlapping colorbar labels
Browse files Browse the repository at this point in the history
- Switch colorbar labels to use scientific notation.
- Reduce labelsize to avoid overlap.
  • Loading branch information
MJJoyce committed Jun 11, 2014
1 parent 8b84418 commit 30e84ef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ocw/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,10 @@ def draw_contour_map(dataset, lats, lons, fname, fmt='png', gridshape=(1, 1),

# Add colorbar
cbar = fig.colorbar(cs, cax=ax.cax, drawedges=True, orientation='horizontal',
extendfrac='auto')
extendfrac='auto', format='%.3e')
cbar.set_label(clabel)
cbar.set_ticks(clevs)
cbar.ax.tick_params(labelsize=6)
cbar.ax.xaxis.set_ticks_position('none')
cbar.ax.yaxis.set_ticks_position('none')

Expand Down Expand Up @@ -672,9 +673,11 @@ def draw_portrait_diagram(results, rowlabels, collabels, fname, fmt='png',
# Add colorbar
cax = ax.cax
cbar = fig.colorbar(cs, cax=cax, norm=norm, boundaries=clevs, drawedges=True,
extend=extend, orientation='horizontal', extendfrac='auto')
extend=extend, orientation='horizontal', extendfrac='auto',
format='%.2e')
cbar.set_label(clabel)
cbar.set_ticks(clevs)
cbar.ax.tick_params(labelsize=6)
cbar.ax.xaxis.set_ticks_position('none')
cbar.ax.yaxis.set_ticks_position('none')

Expand Down

0 comments on commit 30e84ef

Please sign in to comment.