On 08/12/2011 08:07 AM, Benjamin Root wrote: > > > On Fri, Aug 12, 2011 at 12:47 PM, Yoshi Rokuko <yo...@rokuko.net > <mailto:yo...@rokuko.net>> wrote: > > you mean something like that? > > m.contourf(x, y, var, np.linspace(-100,100,33)) > > best regards > > > In addition to that (which would provide control over the contouring), > one can create a Normalization object, and supply that to the contourf > calls to make sure that the coloring is done consistently. Then, I
I think it is usually better to accept the default norm, and simply set the color boundaries using the levels kwarg or the equivalent forth argument as above. > recommend making the colorbar object directly with a cmap and the same > normalization objects that you used for the contourf()'s. This example > should be helpful: I don't agree. It is simpler to pass the ContourSet object to the colorbar command or method. Colorbar knows about contourf and "just works" with it. See http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html for basic contourf with colorbar, and http://matplotlib.sourceforge.net/examples/pylab_examples/multi_image.html for a colorbar with multiple images (contourf plots would work the same). The latter is more complex than is usually needed (it handles interactive changing of the colormap), but illustrates the use of a colorbar in a custom-made axes. > > http://matplotlib.sourceforge.net/examples/api/colorbar_only.html The colorbar_only example should be needed only *very* rarely, if ever. Eric > > Cheers! > Ben Root ------------------------------------------------------------------------------ FREE DOWNLOAD - uberSVN with Social Coding for Subversion. Subversion made easy with a complete admin console. Easy to use, easy to manage, easy to install, easy to extend. Get a Free download of the new open ALM Subversion platform now. http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users