updating changed diagram?

Hi Mathias,

Matthias Michler <MatthiasMichler@...361...> writes:

you can reset the ydata using:
ydata = myline.get_ydata()
ydata += 50
myline.set_ydata(ydata) # pass new data to line object
Does this work for you?

Yes. Altough I dont understand why I have to set it again (the ydata
still belong to the curve)

Thanks,

Ole

Hi Ole,

I think the ydata of the line is updated, but the plot is not updated. To
achieve the latter, you need to use set_ydata. I'm sorry if this was your
original question and I didn't get this.
From the source code of set_data another way seems to be possbilbe - although
quite strange:

ydata += 50
# setting the line invalid in order to force a redraw during draw
myline._invalid = True
draw()

Maybe someone else has an idea about that.

regards Matthias

···

On Wednesday 10 June 2009 13:22:46 Ole Streicher wrote:

Hi Mathias,

Matthias Michler <MatthiasMichler@...361...> writes:
> you can reset the ydata using:
> ydata = myline.get_ydata()
> ydata += 50
> myline.set_ydata(ydata) # pass new data to line object
> Does this work for you?

Yes. Altough I dont understand why I have to set it again (the ydata
still belong to the curve)

Thanks,

Ole

The when you use set_data, the widget is aware the data has changed and sets its _invalid member to True, which triggers a full redraw. When you just modify the array, the line object isn’t aware that the data has changed, and thus just redraws from its (I believe) cached version.

Ryan

···

On Wed, Jun 10, 2009 at 6:22 AM, Ole Streicher <ole-usenet-spam@…361…> wrote:

Hi Mathias,

Matthias Michler <MatthiasMichler@…361…> writes:

you can reset the ydata using:

ydata = myline.get_ydata()

ydata += 50

myline.set_ydata(ydata) # pass new data to line object

Does this work for you?

Yes. Altough I dont understand why I have to set it again (the ydata

still belong to the curve)


Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Norman, Oklahoma, United States