pcolormesh - bus error Numeric - bug

Thanks for the replies - since it worked Ok for other people I looked a bit further:

matplotlib 0.87.2, OS X 10.3.9, Numeric - 23.7, ipython 0.6.15

  running quadmesh_demo.py in examples gives a bus error when the figure is rendered.

It turns out that the collections object returned by the line 16 of quadmesh_demo.py:
ax.pcolormesh(Qx,Qz,Z)

returns vertices with complex values i.e.
b = ax.pcolormesh(Qx,Qz,Z)
c= b._coordinates
c[0]
Out[23]: [ 1.10000002+0.j,-1.99498999+0.j,]

this happens right away in pcolormesh since _coordinates are set there.
If I force a type cast as in:
b._coodinates = b._coodinates.astype(Numeric.Float32)
all goes well

  I suspected that something was screwy in lines of pcolormesh (lines 2422 - 2326) in axes.py:
         coords = zeros(((Nx * Ny), 2),"Float32")
         # Numeric and numpy refuse to cast the Float64 arrays
         # to Float32 with simple assignment, so we do it explicitly.
         coords[:, 0] = X.astype(Float32)
         coords[:, 1] = Y.astype(Float32)

  it appears to be OK for a Float32 BUT if there is a string representation "Float32'" the Numeric module takes only the first character in this case an 'F' which implies complex for Numeric.
all appears OK for numarray and numpy.

---Jim

Jim,

James Boyle wrote:

Thanks for the replies - since it worked Ok for other people I looked a bit further:

matplotlib 0.87.2, OS X 10.3.9, Numeric - 23.7, ipython 0.6.15

running quadmesh_demo.py in examples gives a bus error when the figure is rendered.

It turns out that the collections object returned by the line 16 of quadmesh_demo.py:
ax.pcolormesh(Qx,Qz,Z)

returns vertices with complex values i.e.
b = ax.pcolormesh(Qx,Qz,Z)
c= b._coordinates
c[0]
Out[23]: [ 1.10000002+0.j,-1.99498999+0.j,]

this happens right away in pcolormesh since _coordinates are set there.
If I force a type cast as in:
b._coodinates = b._coodinates.astype(Numeric.Float32)
all goes well

I suspected that something was screwy in lines of pcolormesh (lines 2422 - 2326) in axes.py:
        coords = zeros(((Nx * Ny), 2),"Float32")

In svn I took the quotes out; if I understand correctly, this should solve the problem. Correct?

Eric

···

        # Numeric and numpy refuse to cast the Float64 arrays
        # to Float32 with simple assignment, so we do it explicitly.
        coords[:, 0] = X.astype(Float32)
        coords[:, 1] = Y.astype(Float32)

it appears to be OK for a Float32 BUT if there is a string representation "Float32'" the Numeric module takes only the first character in this case an 'F' which implies complex for Numeric.
all appears OK for numarray and numpy.

---Jim

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users