|
From: Bill B. <wb...@gm...> - 2006-02-13 15:28:16
|
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 <jdh...@ac...> wrote:
>
> >>>>> "Bill" =3D=3D Bill Baxter <wb...@gm...> 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
>
|