problem in showing the plot!!!

when I want to show the plot canvas, it doesn't stay at all, note that I need
to use "backendQtagg", I mean when I use "pylab" there is no problem in
showing the plot canvas, what is the problem? please help me.
I use this simple code:
"
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as
FigureCanvas
from matplotlib.figure import Figure

x = numarray.arange(10)
y = numarray.arange(10)
fig = Figure(figsize=(5, 5))

axes = fig.add_subplot(111)
axes.plot(x,y)
canvas = FigureCanvas( fig)
xlabel('sahar')
canvas.show()
"
The plot just winks.

···

--
View this message in context: http://old.nabble.com/problem-in-showing-the-plot!!!-tp29675128p29675128.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

This is just a complete guess, but I wonder if you might be having conflicting backends. Try adding this to the beginning of your code.

import matplotlib
matplotlib.use(‘QtAgg’)

Also, I wonder if you should be using Qt4Agg?

Ben Root

···

On Fri, Sep 10, 2010 at 4:44 AM, sa6113 <s.payandeh@…287…> wrote:

when I want to show the plot canvas, it doesn’t stay at all, note that I need

to use “backendQtagg”, I mean when I use “pylab” there is no problem in

showing the plot canvas, what is the problem? please help me.

I use this simple code:

"

from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as

FigureCanvas

from matplotlib.figure import Figure

x = numarray.arange(10)

y = numarray.arange(10)

fig = Figure(figsize=(5, 5))

axes = fig.add_subplot(111)

axes.plot(x,y)

canvas = FigureCanvas( fig)

xlabel(‘sahar’)

canvas.show()

"

The plot just winks.