Skip to content

Commit

Permalink
Test and fix for log-scale colour bars
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanwp committed Jan 5, 2017
1 parent 34f0f3b commit 3487c8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cis/plotting/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def add_color_bar(mappable, vstep, logv, cbarscale, cbarorient, cbarlabel):
cbar_kwargs['ticks'] = MultipleLocator(vstep)

if logv:
cbar_kwargs['formatter'] = LogFormatterMathtextSpecial(10, labelOnlyBase=False)
cbar_kwargs['format'] = LogFormatterMathtextSpecial(10, labelOnlyBase=False)
#
if cbarscale is not None:
cbar_kwargs['shrink'] = cbarscale
Expand Down
8 changes: 8 additions & 0 deletions cis/test/plot_tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,3 +989,11 @@ def test_can_specify_yaxis_altitude(self):
d.plot(yaxis='altitude')

self.check_graphic()

def test_log_colorbar_scale(self):
from cis import read_data
d = read_data(valid_aerosol_cci_filename, valid_aerosol_cci_variable)
d.plot(logv=True)

self.check_graphic()

0 comments on commit 3487c8a

Please sign in to comment.