2010/3/28 Chloe Lewis <chle...@berkeley.edu>: > That would be a lot nicer, Friedrich; could you share demo code? I can't > make the set_ylim work, but I think I'm being clumsy with the object model.
It seems that I cannot read the sections following after the "From this:" and "I get this:"? But anyway, I solved it for you :-) See attached script. colorbar() takes the argument *boundaries*, defining the region to draw. It's code from Alan G Isaac slightly modified and also posted there back, too. You will want to run the code via python -i norm.py. For the vmin and vmax, if you like it more you can also pass in norm = matplotlib.colors.Normalize(vmin, vmax) instead. Note that the ticking is a bit weird, there is also a bug in matplotlib I will report on right after this e-mail, whose bugfix you will maybe want to apply to get ticking properly working. When you have insane values for C.min() and C.max() anyway, I'm afraid you have to retick manually with *ticks* to colorbar(). The ticker.MaxNLocator is only used when not using the *boundaries* arg to colorbar(), unfortunately. Otherwise it tries to create maximal many and less than 11 ticks by using the lowest value and an appropriate step in *boundaries*. I think the implementation of ticking is cumbersome and never optimal. Friedrich
norm.py
Description: Binary data
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users