On Tue, Jan 17, 2012 at 9:30 AM, Michael Rawlins <rawlins02@yahoo.com> wrote:

I'm relatively new to matplotlib. Trying to place a colorbar in a figure. The code below, placed in a file and executed with python, draws 4 maps using basemap. I've been unable to get a colorbar to show up anywhere on the figure. Ideally I would like the option of placing a colorbar across the bottom, spanning across both bottom map panels.  Also would need the option of placing a colorbar either to the right of or below each map. Uncommenting the two lines under "Here make a colorbar" cause an error. I've used those commands when creating just one map using the figure command.

TIA,
Mike



Mike,

Try using the axes_grid1 toolkit to produce your axes objects and to allocate enough room for colorbars.

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html

Cheers!
Ben Root

P.S. - a little history, there used to be an axes_grid toolkit, but has since been superseded by axes_grid1.