In [4]:
from nansat import *
%matplotlib inline

In [13]:
from matplotlib import pyplot
import matplotlib as mpl

# Make a figure and axes with dimensions as desired.
fig = pyplot.figure(figsize=(8,3))
ax1 = fig.add_axes([0.05, 0.80, 0.9, 0.15])
ax2 = fig.add_axes([0.05, 0.475, 0.9, 0.15])


# ColorbarBase derives from ScalarMappable and puts a colorbar
# in a specified axes, so it has everything needed for a
# standalone colorbar.  There are many more kwargs, but the
# following gives a basic continuous colorbar with ticks
# and labels.
cb1 = mpl.colorbar.ColorbarBase(ax1, cmap=mpl.cm.jet,
                                   norm=mpl.colors.Normalize(vmin=-5, vmax=13),
                                   orientation='horizontal')
cb1.set_label('SST, K')


# ColorbarBase derives from ScalarMappable and puts a colorbar
# in a specified axes, so it has everything needed for a
# standalone colorbar.  There are many more kwargs, but the
# following gives a basic continuous colorbar with ticks
# and labels.
cb2 = mpl.colorbar.ColorbarBase(ax2, cmap=mpl.cm.bone,
                                   norm=mpl.colors.Normalize(vmin=0, vmax=100),
                                   orientation='horizontal')
cb2.set_label('ice concentration, %')



In [ ]: