# colorbar¶

mipylib.plotlib.miplot.colorbar(layer, **kwargs)

Add a colorbar to a plot.

Parameters: layer – (MapLayer) The layer in plot. cmap – (string) Color map name. Default is None. shrink – (float) Fraction by which to shrink the colorbar. Default is 1.0. orientation – (string) Colorbar orientation: vertical or horizontal. aspect – (int) Ratio of long to short dimensions. fontname – (string) Font name. Default is Arial . fontsize – (int) Font size. Default is 14 . bold – (boolean) Is bold font or not. Default is False . extendrect – (boolean) If True the minimum and maximum colorbar extensions will be rectangular (the default). If False the extensions will be triangular. extendfrac – [None | ‘auto’ | length] If set to None, both the minimum and maximum triangular colorbar extensions with have a length of 5% of the interior colorbar length (the default). If set to ‘auto’, makes the triangular colorbar extensions the same lengths as the interior boxes . If a scalar, indicates the length of both the minimum and maximum triangle colorbar extensions as a fraction of the interior colorbar length. ticks – [None | list of ticks] If None, ticks are determined automatically from the input.

Example:

f = addfile('D:/Temp/GrADS/model.ctl')
psv = f['PS']
ps = psv[0,[10,60],[60,140]]
axesm()