[Numpy-discussion] matplotlib

Bill Baxter wbaxter at gmail.com
Mon Feb 13 07:29:02 CST 2006


from numpy import *

was the only line missing, called before the rest.
It seems to work fine if I use
     from pylab import *
instead of
     import pylab as g

And actually if I do both in this order:
     import pylab as g
     from pylab import *

then plot() and g.plot() both do the right thing (no truncating of floats).
Seems as if there's some initialization code that only gets run with the
'from pylab import *' version.

--bb

On 2/14/06, John Hunter <jdhunter at ace.bsd.uchicago.edu> wrote:
>
> >>>>> "Bill" == Bill Baxter <wbaxter at gmail.com> writes:
>
>     Bill> Anyone know if matplotlib is supposed to work with the new
>     Bill> NumPy or if there is work afoot to make it work?  It seems
>     Bill> to truncate all numpy.array and numpy.matrix inputs to
>     Bill> integer values:
>
> You're script as posted is incomplete
>
>     import matplotlib
>     matplotlib.interactive(True)
>     matplotlib.use('WXAgg')
>     import matplotlib.pylab as g
>
>     g.plot(rand(5),rand(5),'bo')
>
> where for example is rand coming from?  My guess is you have an import
> statement you are not showing us.
>
> If you are using a recent numpy and matplotlib, and set numerix to
> numpy in your matplotlib rc file (~/.matplotlib/matplotlibrc)
> everything should work if you get your array symbols from pylab, numpy
> or matplotlib.numerix (all of which will get their symbols from
> numpy....)
>
> JDH
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060213/0674e939/attachment.html 


More information about the Numpy-discussion mailing list