How to set the data for an existing pcolormesh image?

Hello,
for a interactive gui program i want to change the shown data without changing
the rest of the figure. For normal plots, there is a set_xdata/set_ydata
methods. For QuadMesh, there is a set_array method, which i don't get to work.

Thanks,
Till

Hello,
for a interactive gui program i want to change the shown data without changing
the rest of the figure. For normal plots, there is a set_xdata/set_ydata
methods. For QuadMesh, there is a set_array method, which i don't get to work.

You have to use ravel(). Illustrated with ipython -pylab:

xx = pcolormesh(rand(3,3))
xx.set_array(rand(3,3).ravel())
draw()
xx.set_array(rand(3,3).ravel())
draw()

Eric

ยทยทยท

On 08/15/2011 11:10 PM, Till Stensitzki wrote:

Thanks,
Till