On Thu, Nov 18, 2010 at 11:10 PM, John <washa...@gmail.com> wrote:
> 1) I only need one colorbar, how would I create a single colorbar on
> the right that spanned across all axes? (ie. same height as the stack)

There are a few options you can try. I guess the easiest way is
setting up the axes manually.

dy = 0.8/3.
ax1 = axes([0.1, 0.1, 0.8, dy])
ax2 = axes([0.1, 0.1+dy, 0.8, dy])
ax3 = axes([0.1, 0.1+2*dy, 0.8, dy])

sc = ax1.scatter([1,2],[3,4], c=[0,1], cmap="jet")
cax = axes([0.9, 0.1, 0.03, 0.8])
plt.colorbar(sc, cax=cax)

Also, you make take a look at the axes_grid1 toolkit.
(see e.g, 
http://matplotlib.sourceforge.net/examples/axes_grid/demo_axes_grid.html)

> 2) is there a way to place the colorbar in the bottom middle of my
> panels (if I end up with more than one)?

Use loc=8.

> 3) How can I customize the tick labels of the colorbar?

You may use "set_ticks" and "set_ticklabels" method of the colorbar object.

       cb = plt.colorbar(a.collections[0],cax=ia,orientation='horizontal')
       cb.set_ticks([-100,0,100])
       cb.set_ticklabels(["-100", "0", "+100"])

Also, locators and formatter can be specified during colorbar creation
(take a look at the doc).

-JJ

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to