To reply to my own post: On question (1): I modified the
> call to colorbar in pylab.py to accept a color map and norm
> 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.
> I would also like to code up a floating color bar. Often I
> make 4/5 images per page with a common colormap and
> normalization. It is handy just to plop the reference
> colorbar in a central location not attached to a particular
> 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()
> On question (2): Alan Isaac pointed out that using the same
> edgecolor as the fillcolor would make the borders
> invisible.
Yep.
JDH