I am trying to use imshow() with a dinamically changing set of matrices=
What my application does, is just to respond to a user selection from a
wxPython radiobutton and, based on the user's choice, display a different
matrix on a matplotlib figure (I am using the OO interface). I also have an
horizontal colorbar to let the user orient himself over the matrix
values. Well, these matrices have different magnitues in value, and I was
expecting that the colorbar would be updated with the new image data.
Isn't the colorbar supposed to update when the input image/pcolor/whatever
This is what I have at the moment:
self.palette =3D matplotlib.cm.jet
minp =3D min(property)
maxp =3D max(property)
# here do the property reshape to get a matrix...
# imshow the matrix
if not hasattr(self, "image"):
self.image =3D self.leftaxis.imshow(property, cmap=3Dself.palette,
# if it doesn't exist, create a colorbar
if not hasattr(self, "colorbar"):
self.colorbar =3D self.fig.colorbar(self.image, cax=3Dself.cax,
It doesn't work... I mean, the colorbar axis limits are updated, but not th=
colorbar colors. Let's suppose that the first matrix has a
min(property)=3D1000 and max(property)=3D10000, I get that values around 10=
are red/maroon. When I select the second matrix, with min(property)=3D1 and
max(property)=3D10, everything in the colorbar is red/maroon...
Is there a solution for this kind of problem? Am I missing something?
Thank you very much for your suggestions.
"Imagination Is The Only Weapon In The War Against Reality."