The 2D scatter plot ignores points that have NaN values. The 3D scatter plot should do the same to match the 2D functionality as closely as possible. Here is some test code to demonstrate:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
This is the exception that I get. The issue is that the zs, array has 3 values, when the xs and ys arrays only have 2. Because the NaN valued points are removed from the xs and ys arrays, but the zs array is untouched.
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/local/lib/python2.6/lib-tk/Tkinter.py", line 1410, in call
return self.func(_args)
File "/usr/local/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py", line 212, in resize
self.show()
File "/usr/local/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py", line 215, in draw
FigureCanvasAgg.draw(self)
File "/usr/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.py", line 394, in draw
self.figure.draw(self.renderer)
File "/usr/local/lib/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *kl)
File "/usr/local/lib/python2.6/site-packages/matplotlib/figure.py", line 802, in draw
func(_args)
File "/usr/local/lib/python2.6/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 152, in draw
for col in self.collections]
File "/usr/local/lib/python2.6/site-packages/mpl_toolkits/mplot3d/art3d.py", line 303, in do_3d_projection
vxs, vys, vzs, vis = proj3d.proj_transform_clip(xs, ys, zs, renderer.M)
File "/usr/local/lib/python2.6/site-packages/mpl_toolkits/mplot3d/proj3d.py", line 202, in proj_transform_clip
vec = vec_pad_ones(xs, ys, zs)
File "/usr/local/lib/python2.6/site-packages/mpl_toolkits/mplot3d/proj3d.py", line 184, in vec_pad_ones
vec = np.array([xs,ys,zs,np.ones((len(xs)))])
ValueError: setting an array element with a sequence.
SourceForge History
On Sun May 30 15:09:16 2010, by efiring: assigned_to: 100
Activity
WeatherGod commented on Jun 22, 2011
This appears to have been fixed. Closing...