Mads,

On Thu, Jun 28, 2012 at 3:12 AM, Mads Ipsen <madsip...@gmail.com> wrote:

>  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
>

The only way I could think of to do what you want a bit more intelligently
is to reuse the existing QuadContourMesh that comes from the initial call
to contourf.  Updates to that "ScalarMappable" object should then trigger
updates to the existing colorbar.  Not entirely sure which code would be
cleaner, though, because reusing a QuadContourMesh isn't easy.

Cheers!
Ben Root
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to