I have two quick questions about colorbars in matplotlib.  The first is
related to the size of the colorbar.  I would like to have square axes for a
plot, so I use:
ax=fig.add_subplot(1,2,1)
pc=ax.pcolor(X,Z,P2)
ax.set_aspect(1./ax.get_data_ratio())
cb=pylab.colorbar(pc,orientation='vertical')

However, here I find that the colorbar is as long as the original image
rather than the scaled image.  Is there a good way around this?

pylab.axis('equal')
and
pylab.axis('scaled')
have not helped.

The second question is related to the choice of tickmarks for the colorbar.
 If I would like to have only say 4 ticks on colorbar, I tried:
cb.ax.xaxis.set_major_locator(MaxNLocator(4)), however, the range for the
colorbar is now incorrect.  Suggestions?  I am using
version 0.99.0

Thanks,
William
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to