some issues

Hi

I like MPL very much since I'm used to MATLAB and it's fantastic plotting features
but I have 3 little issues (most likely newbie stuff :slight_smile: to solve.

1.)
To change the backend interactively the MPL homepage suggests something like

聽聽import matplotlib
聽聽from pylab import *
聽聽matplotlib.use(<backend-name-string>)
聽聽plot(...); show()

But I found that whatever backend I tell MPL to use, it always uses the one defined in my .matplotlibrc.

2.)
When I start my Python shell (IPython, WinXP) and use MPL the 1st time in the session

聽聽from pylab import *
聽聽plot(...); show()

the plot window appears but I'm not able to type anything in the shell. I close the plot window and

聽聽plot(...); show()

again. From now on I'm able to type in the shell. What's up?

3.)
I tried to plot a data set with 1024 points (shape(x) = shape(y) = (1024,)).

聽聽plot(x,y)

which takes about 4 seconds to build up the plot (at least with the TkAgg backend). This is far to slow for me. What can I do?

Cheers,
Steve

路路路

--
Man is the best computer we can put aboard a spacecraft ... and the only one that can be
mass produced with unskilled labor. - Wernher von Braun

Hi Steve,

Hi

I like MPL very much since I'm used to MATLAB and it's fantastic plotting
features but I have 3 little issues (most likely newbie stuff :slight_smile: to solve.

1.)
To change the backend interactively the MPL homepage suggests something
like

聽聽import matplotlib
聽聽from pylab import *
聽聽matplotlib.use(<backend-name-string>)
聽聽plot(...); show()

But I found that whatever backend I tell MPL to use, it always uses the one
defined in my .matplotlibrc.

If you saw this on the website, it is an error. (I could not find it myself.)
You need to do

import matplotlib
matplotlib.use(<backend-name-string>)
from pylab import *
plot(...); show()

2.)
When I start my Python shell (IPython, WinXP) and use MPL the 1st time in
the session

聽聽from pylab import *
聽聽plot(...); show()

the plot window appears but I'm not able to type anything in the shell. I
close the plot window and

聽聽plot(...); show()

again. From now on I'm able to type in the shell. What's up?

This is due to the interactive nature of MPL. By default, interactive mode is
off, to improve performance in scripts. Have you looked into IPython as an
alternative to the interactive python interpretter? (Its not really a shell,
by the way.) If you dont want to use IPython, try this before you import
pylab

import matplotlib
matplotlib.interactive(True)
from pylab import *

3.)
I tried to plot a data set with 1024 points (shape(x) = shape(y) =
(1024,)).

聽聽plot(x,y)

which takes about 4 seconds to build up the plot (at least with the TkAgg
backend). This is far to slow for me. What can I do?

I'll have to defer to the MPL overlords on this one, I dont know enough to
answer well.

路路路

On Wednesday 27 April 2005 1:39 pm, steve schmerler wrote:

--
Darren S. Dale

Bard Hall
Department of Materials Science and Engineering
Cornell University
Ithaca, NY. 14850

dd55@...163...