Hi,
Suppose you do this:
axes = self.figure().get_axes()
contour = axes.contourf(x,y,z)
colorbar = self.figure().colorbar(contour)
Suppose that the contour data changes, can you update the colorbar
with the new data?
Currently I remove the colorbar and insert a new one - but I have
a feeling that something smarter could be done.
Best regards,
Mads
···
-- +-----------------------------------------------------+
| Mads Ipsen |
+----------------------+------------------------------+
| Gåsebæksvej 7, 4. tv | |
| DK-2500 Valby | phone: +45-29716388 |
| Denmark | email: |
+----------------------+------------------------------+
mads.ipsen@…287…
Hi,
Suppose you do this:
axes = self.figure().get_axes()
contour = axes.contourf(x,y,z)
colorbar = self.figure().colorbar(contour)
Suppose that the contour data changes, can you update the colorbar with
the new data?
Currently I remove the colorbar and insert a new one - but I have a
feeling that something smarter could be done.
When you say "the contour data changes", I assume you mean you are contouring a new set of data, with new contour levels, and not just changing the cmap. In this case there is no point in trying to save something from the old colorbar, so remaking it is the right thing to do. Simple, effective, foolproof. (If only the cmap is changed, then the existing colorbar should be getting updated automatically.)
Eric
···
On 06/27/2012 09:12 PM, Mads Ipsen wrote:
Best regards,
Mads