pylab package dependencies (was: Plotting histograms)

Lou Pecora pecora at anvil.nrl.navy.mil
Tue Oct 17 09:39:16 EDT 2006


In article <mailman.604.1161057667.11739.python-list at python.org>,
 Robert Kern <robert.kern at gmail.com> wrote:

> I presume what you did was something like this:
> 
>    from matplotlib import pylab
>    [N,x] = hist(eig, 10)
> 
> What you actually want is this:
> 
>    from matplotlib import pylab
>    [N,x] = pylab.hist(eig, 10)
> 
> Or, if you're at the interactive prompt (but remember that it is inadvisable 
> to 
> do so in modules):
> 
>    from matplotlib.pylab import *
>    [N,x] = hist(eig, 10)
> 
> You will probably want to review the section of the tutorial on importing 
> modules if you don't understand the differences.


Is pylab part of matplotlib?  I always thought it was the other way 
around. I have a similar view of numpy as part of scipy.  Maybe I'm 
confused on the dependencies.  I find it confusing in the examples 
sometimes when the "bigger" package is imported (e.g. scipy) and then a 
"subpackage" is also imported.  Like this:

from scipi import *
from scipi import numpy

I know I've seen stuff like that, but I don't get it.  The dependencies 
are confusing to me.  

I did a search of the tutorial on 'import' but didn't find the answer.

-- Lou Pecora  (my views are my own) REMOVE THIS to email me.



More information about the Python-list mailing list