Repository: climate Updated Branches: refs/heads/master cbe10b793 -> a52932dba
CLIMATE-472 - Fix overlapping colorbar labels - Switch colorbar labels to use scientific notation. - Reduce labelsize to avoid overlap. Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/30e84efa Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/30e84efa Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/30e84efa Branch: refs/heads/master Commit: 30e84efaa94fd93a532a95a073f8096417c08244 Parents: 8b84418 Author: Michael Joyce <[email protected]> Authored: Tue Jun 10 21:15:13 2014 -0700 Committer: Michael Joyce <[email protected]> Committed: Tue Jun 10 21:15:13 2014 -0700 ---------------------------------------------------------------------- ocw/plotter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/30e84efa/ocw/plotter.py ---------------------------------------------------------------------- diff --git a/ocw/plotter.py b/ocw/plotter.py index 33a1bd1..9e7080d 100644 --- a/ocw/plotter.py +++ b/ocw/plotter.py @@ -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') @@ -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')
