matplotlib basic question

Colin J. Williams cjw at sympatico.ca
Fri Apr 20 10:16:30 EDT 2007


orangeDinosaur wrote:
> Hi,
> 
> I am exploring the possibility of using python as a replacement of
> MATLAB when I leave school.  So, I've been playing with matplotlib and
> have run into some weird behavior after recently installing python
> 2.5.1 and matplotlib 0.90 on my Windows XP machine. Here's an example
> of what I see:
> 
>>> >from matplotlib.pylab import *
>>>> x=arange(-2*pi,2*pi,pi/24)
>>>> y=sin(x)
>>>> plot(x,y)
> [<matplotlib.lines.Line2D instance at 0x017C38C8>]
>>>> show()
> 
> 
> So, first off, what's up with the [<matplotlib.lines.Line2D instance
> at 0x017C38C8>] line that shows up after my plot command?  And second,
> when I call show(), a new figure pops up with my sin wave -- seems all
> right, yes? But I'm not given another >>> prompt in IDLE until or
> unless I close the figure that popped up with the show() call.
> 
> So, after closing the figure I type this:
> 
>>>> show()
>>>> plot(x,y)
>>>>
> 
> and this time another figure pops up with my sine wave again and I get
> a prompt as well.  But now, the figure window is completely
> unresponsive -- I can't even close it without getting the "your
> program is not repsonding" business.  What am I missing?  This
> behavior so far seems pretty unintuitive.
> 
> Any clarification is appreciated!
> 
> trevis
> 
Trevis,

You might look at Numpy, which deals with multi-dimensional arrays.

It has a small matrix component and some progress has been made with 
MATLAB amenable problems.

Colin W.




More information about the Python-list mailing list