From: John H. <jdh...@ac...> - 2005-01-15 22:59:32
|
>>>>> "James" == James Boyle <bo...@ll...> writes: James> To reply to my own post: On question (1): I modified the James> call to colorbar in pylab.py to accept a color map and norm James> keyword arguments. It was this functionality that was Perhaps it would be cleaner simply to derive a custom class from ScalarMappable that does your fill calls and stores your cmap and norm instances; then you would get the observer stuff for free. If you decide to go this route, perhaps you could submit the example. James> I would also like to code up a floating color bar. Often I James> make 4/5 images per page with a common colormap and James> normalization. It is handy just to plop the reference James> colorbar in a central location not attached to a particular James> figure. I just committed changes to CVS to support this -- you can now place a colorbar in a custom axes, and I added an orientation kwarg to support horizontal or vertical colorbar layout. Make sure you get pylab.py revision 1.21 or later. Here is an example from pylab import * ax = axes([0.1, 0.3, 0.8, 0.6]) im = imshow(rand(12,12), interpolation='nearest') cax = axes([0.1, 0.1, 0.8, 0.15]) colorbar(cax=cax, orientation='horizontal') show() James> On question (2): Alan Isaac pointed out that using the same James> edgecolor as the fillcolor would make the borders James> invisible. Yep. JDH |