Description
Hello,
In the 0.9.6 version, it does not appear to be possible to pass any arguments to the colorbar plotting
routine.
xarray/xarray/plot/facetgrid.py
Line 239 in 8267fdb
explicitly sets set_colorbar = False, which makes sense.
However, if we want horizontal colorbars, or any way of adjusting the colorbar plotted (it is huge and unwieldy), it would be good if the plotting routine checks for and passes suitable arguments to
xarray/xarray/plot/facetgrid.py
Line 256 in 8267fdb
I tried hacking something together, I can do something like the following now:
import xarray
import matplotlib.pyplot as plt
data = xarray.open_dataset('/data/ERSST/sst.mnmean.old.nc').sst
data = data.loc[dict(time=slice('1999-1', '1999-4'))]
data.plot.contourf(col='time', col_wrap=2, levels=12, cbar_kwargs=dict(orientation='horizontal',
pad=0.1, aspect=30, shrink=0.6, ticks=[0, 10, 20 ,30]))
which produces:
Is something like this available in the development version? If not, and it seems like a useful feature, I can create a PR.
Joy