On Sun, Oct 5, 2008 at 3:50 AM, rocha <[EMAIL PROTECTED]> wrote:

>>> self.canvas.figure.clf()
>>> self.canvas.draw()
>>> self.canvas.axes.plot([1.,2.,4.])
>>>
>>> and nothing is plotted. The Figure is totally gray. I tried to do the
>>> same thing in embedding_in_qt4.py example, modifying some parts, but it
>>> didn't work too.
>>>
>>> Do you have any suggestions?

The problem appears to be that you have kept a copy of your old axes
around (self.canvas.axes is not a mpl construct, so it looks like you
have attached an axes instance to your canvas instance).  You will
want to either not clear your figure and clear your axes instead

  ax.cla()
  ax.plot([1,2,3])
  canvas.draw()

or clear your figure, create a new axes, plot and then draw

   fig.clf()
   ax = fig.add_subplot(111)
   ax.plot([1,2,3])
   ax.draw()

Be careful with the name "axes" to refer to a single axes instance
attached to your canvas.  In the mpl scheme, axes is a list of Axes
instance and is attached to the Figure instance.  See for example

  http://matplotlib.sourceforge.net/doc/html/users/artists.html

JDH

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to