Thanks for that. It works fairly well, but I've noticed that the graph content (the candlesticks) move slightly faster than the x axis. I've added a sleep(0.1) statement to slow things down, and we can see that at the start the first bar is displayed at around 13:15 but by the times is gets to the left, the same bar is then displayed at about 13:00.
Do you have any suggestion on how to improve that?
Apart from that, shifting the graph is quite fast. On my machine, I get a frame rate of 30 FPS if I redraw both X and Y axis. The rate goes much higher ( greater than 100 FPS) if I don't redraw the axis.
animation_blit_gtk2-2.py (30.4 KB)
From: Jae-Joon Lee [mailto:lee.j.joon@…287…]
Sent: 05 August 2009 03:36
To: Christophe Dupre
Subject: Re: [Matplotlib-users] 0.99.0-RC1 and the animation_blit_gtk2 example
On Tue, Aug 4, 2009 at 12:14 PM, Christophe Dupre<christophe.dupre@...2631...> wrote:
I've been playing with the animation_blit_gtk2 example
) and the latest version of matplotlib version 0.99.0-RC1.
I've modified the example so that it displays candlesticks moving towards
the lelf. The example is attached if anybody is interested.
In my example, I'm using 1 minute bars and therefore I would like to shift
the graph by 1 minute instead of a few pixels. Is there a way to convert a
time difference into pixels?
The "get_dx_data" method coverts a pixel offset to a data offset.
So, what you need is just to invert it.
This requires some knowledge of transformation, but I guess the code
is rather self-explanatory.
For example, something like below will work (sorry, I haven't
actually tested the code)
def get_dx_pixel(self, dx_data):
tp = self.ax.transData.transform_point
x0, y0 = tp((0, 0))
x1, y1 = tp((dx_data, 0))
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
Matplotlib-users mailing list
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.392 / Virus Database: 270.13.43/2281 - Release Date: 08/04/09 05:57:00