|
From: Benjamin R. <ben...@ou...> - 2015-02-05 21:43:35
|
Yup, that is a real bug... self._facecolors2d doesn't get set until the first draw. It really shouldn't be accessing _facecolors2d because the elements can change order depending on the rotation of the display. Could you file the bug report, please? Thanks! Ben Root On Thu, Feb 5, 2015 at 4:32 PM, Oliver <oli...@gm...> wrote: > Greetings, > > before I submit an issue I usually try to confirm on the mailing list that > the issue I'm experiencing is not just on my system. > At the moment, I've tested this only on my personal laptop, but in virtual > environments. > One venv has mpl version 1.3.1, the other has just been installed (with > only numpy, matplotlib and ipython) and thus has mpl version 1.4.2. > > In both environments the following script fails: > > import numpy as np > import matplotlib.tri as mtri > import matplotlib.pyplot as plt > from mpl_toolkits.mplot3d import Axes3D > > y,x = np.ogrid[1:10:100j, 1:10:100j] > z = x**2-x*y > z2 = np.cos(x)**3 - np.sin(y)**2 > fig = plt.figure() > ax = fig.add_subplot(111, projection='3d') > r = ax.plot_surface(x,y,z2, cmap='hot') > r.get_facecolors() > > It fails on the last line with the following traceback: > --------------------------------------------------------------------------- > AttributeError Traceback (most recent call last) > <ipython-input-13-de0f41d662cd> in <module>() > ----> 1 r.get_facecolors() > > /home/oliver/.virtualenvs/mpl/local/lib/python2.7/site-packages/mpl_toolkits/mplot3d/art3d.pyc > in get_facecolors(self) > 634 > 635 def get_facecolors(self): > --> 636 return self._facecolors2d > 637 get_facecolor = get_facecolors > 638 > > AttributeError: 'Poly3DCollection' object has no attribute '_facecolors2d' > > Can anyone confirm on their system that this is a bug? > I have the same error appearing for `get_facecolor()` (without the s) by > the way. > > Regards, > > Oliver > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |