[SciPy-user] Bug in matplotlib plot_wireframe?

Shane Legg shane at vetta.org
Mon Feb 25 11:14:27 EST 2008


Hi,

I'm new here so if this isn't the right place to ask just let
me know where I should head.  Thanks.

I think there is a significant bug in plot_wireframe in matplotlib
where it incorrectly displays the Z axis values.  The code below
demonstrates the problem:


import scipy
import pylab as p
import matplotlib.axes3d as p3
from numpy import *

"""
# If you do a wire frame of the following, the graph is correct:
Z = scipy.array(
[[ 0.52,  0.00020],
 [ 0.45,  0.00018],
 [ 0.34,  0.00016]] )
"""

# but if you put negative signs in:
Z = scipy.array(
[[ -0.52,  -0.00020],
 [ -0.45,  -0.00018],
 [ -0.34,  -0.00016]] )

"""
 the graph displays:
[[ -0.62, -0.10020 ],
 [ -0.55, -0.10018 ],
 [ -0.44, -0.10016 ]]
"""

X, Y = meshgrid(arange(0, 3, 1.0), arange(0, 4, 1.0))

fig = p.figure()
ax = p3.Axes3D(fig)
ax.plot_wireframe(X, Y, Z)

ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')

p.show()


I'm running Ubuntu 7.10 x64 with python 2.5.1-1ubuntu2 and
python-scipy 0.5.2-9ubuntu4 both installed from the .deb files.
I sent the above code to somebody with a 32bit Linux system
and they had the same problem.

Any help appreciated!

Cheers
Shane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20080225/6f9bbe82/attachment.html>


More information about the SciPy-User mailing list