From: John H. <jdh...@ac...> - 2004-09-13 21:37:10
|
>>>>> "Rodrigo" == Rodrigo Caballero <rc...@ge...> writes: Rodrigo> One of my favorite aspects of matplotlib is how easy it Rodrigo> is to make dynamic plots. When doing this with 2D Rodrigo> renderings using pcolor or imshow, is there an easy way Rodrigo> to also dynamically update the colorbar? It should *just work*. images (matplotlib.image.AxesImage) and pcolors (matplotlib.collections.PolygonCollection) both derive from matplotlib.cm.ScalarMappable. This class implements an observer pattern, and the colorbar registers itself with the ScalarMappable instance. If you change the normalization, or colormap, or colorlimits, the ScalarMappable instance notifies it's observers, who update automagically. Let me know if you run into any troubles. JDH |