On Sat, Apr 19, 2008 at 11:23 PM, hjc520070 <[EMAIL PROTECTED]> wrote:
>
>  I work matplotlib on wxpython, python2.5.
>  It is wonderful that the following code work faster than canvas.draw().
>             canvas.restore_region(background)
>             ##Updata three lines and draw it.
>             line.set_data(x,y)
>             ax.draw_artist(line)
>             canvas.blit(ax.bbox)
>             canvas.gui_repaint()
>  When I creat a frame and set frame.Show(True). Then ,refresh the line on
>  canvas with above method. It works.
>  However,When I creat a frame and set frame.Show(False). Then ,refresh the
>  line on canvas with above method. It fails. And get the following message.
>  '''
>  File "C:\Python25\Lib\site-packages\matplotlib\axes.py", line 1299, in
>  draw_artist
>     assert self._cachedRenderer is not None
>  AssertionError
>  '''
>  I creat a lot of frames and do not want to show it at frist. However, when
>  with frame.Show(False), I can refresh the canvas. Is there any solution?
>  Could anyone help me?  Your help will be appreciated a lot. Thanks.

You cannot call "draw_artist" until after the initial draw.  So you
will either need to explicitly call fig.canvas.draw() first or put
your draw_artist command in a GUI handler that is not called until
after the initial draw event.

JDH

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to