Updating tick labels when using animation

Hi,
I'm using an animated graph in which most of the time I don't want it
to autoscale (due to speed). Once in a while I want it to change the
limits of the y-axis. In order to do this I use set_ylim and follow by
a canvas.draw(). However it does not actually redraw the canvas and
the old tick labels remain (although the scales are reset). When I
manually resize the canvas in updates the tick labels. Any ideas what
I'm doing wrong?

Elan

···

--
If I knew that a man was coming to my house with the conscious design
of doing me good, I should run for my life.
- Henry David Thoreau

This doesn't sound right -- a call to canvas.draw should redraw the
whole canvas cleanly, with the exception of Artists where the animated
property is set. Can you reduce your code to a free-standing example
that we can run?

JDH

···

On Wed, Jun 17, 2009 at 5:27 PM, Elan Pavlov<epavlov@...287...> wrote:

Hi,
I'm using an animated graph in which most of the time I don't want it
to autoscale (due to speed). Once in a while I want it to change the
limits of the y-axis. In order to do this I use set_ylim and follow by
a canvas.draw(). However it does not actually redraw the canvas and
the old tick labels remain (although the scales are reset). When I
manually resize the canvas in updates the tick labels. Any ideas what
I'm doing wrong?

Hi John,
I solved the bug. In my application I have several threads. One of the
threads updates the graph on a timer and another gets data from the
application in order to plot.
The thread updating the limits was based on data coming from the
application. As I stated this is a two part process where the first
part is setting the limits and the second is redrawing the graph
(followed by updating the background). The problem is when the thread
loses control between these two stages. In this case the background is
updated to the old limits although the 'real' limits remain the
updated version.
The solution is to use a lock to ensure that everything is done
atomically. This results in the desired behaviour.
IOW it was completely my fault although an interesting bug:)

Elan

···

---
Fortunately, the second-to-last bug has just been fixed.
- Ray Simard

On Wed, Jun 17, 2009 at 7:20 PM, John Hunter<jdh2358@...287...> wrote:

On Wed, Jun 17, 2009 at 5:27 PM, Elan Pavlov<epavlov@...287...> wrote:

Hi,
I'm using an animated graph in which most of the time I don't want it
to autoscale (due to speed). Once in a while I want it to change the
limits of the y-axis. In order to do this I use set_ylim and follow by
a canvas.draw(). However it does not actually redraw the canvas and
the old tick labels remain (although the scales are reset). When I
manually resize the canvas in updates the tick labels. Any ideas what
I'm doing wrong?

This doesn't sound right -- a call to canvas.draw should redraw the
whole canvas cleanly, with the exception of Artists where the animated
property is set. Can you reduce your code to a free-standing example
that we can run?

JDH

--
If I knew that a man was coming to my house with the conscious design
of doing me good, I should run for my life.
- Henry David Thoreau