I guess you need to put draw() after plot()

self.canvas.figure.clf()
self.canvas.axes.plot([1.,2.,4.])
self.canvas.draw()

Let us know if it does not help.

-JJ



On Sat, Oct 4, 2008 at 7:17 PM, rocha <[EMAIL PROTECTED]> wrote:
> Hi Guys,
>
> I need to clear the Figure after the user has clicked the some button in
> PyQt, but when I try to plot the graphics again nothing appear. In
> ipython it works, but when I try it inside my application it does not
> work. What am I missing?
>
> Inside my MplCanvas class (actually it is a QWidget - see
> embedding_in_qt4.py in matplotlib examples file - user_interface) I have
> this code:
>
> self.fig = Figure(figsize=(self.width, self.height), dpi=dpi)
>
> And then in my main application I'm trying to do:
>
> 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?
>
> Thanks!
> Best regards,
> Bernardo M. Rocha
>
> -------------------------------------------------------------------------
> 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
>

-------------------------------------------------------------------------
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