<p dir="auto">I encountered a missing attribute bug while using matplotlib 1.5.3 on linux.  New to the community so apologies if this isn't the right way to raise the issue, I did read the [coding guidelines] (<a href="http://matplotlib.org/devel/coding_guide.html" rel="nofollow">http://matplotlib.org/devel/coding_guide.html</a>) but it was still unclear for small bugfixes what the procedure is.</p>
<p dir="auto">I found I was getting a missing <code class="notranslate">_facecolor2d</code> attribute error in the Patch3D class in mplot3d/art3d.py.  It seems like the attribute just wasn't being set so I added it (diff below) and it resolved the problem.</p>
<p dir="auto">There is a FIXME comment related to facecolor2d just below this point in the code, so someone may have had another fix in mind.</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py
index 4ecfb32..73daa6e 100644
--- a/lib/mpl_toolkits/mplot3d/art3d.py
+++ b/lib/mpl_toolkits/mplot3d/art3d.py
@@ -266,6 +266,7 @@ class Patch3D(Patch):
         self._segment3d = [juggle_axes(x, y, z, zdir) \
                 for ((x, y), z) in zip(verts, zs)]
         self._facecolor3d = Patch.get_facecolor(self)
+        self._facecolor2d = self._facecolor3d
 
     def get_path(self):
         return self._path2d"><pre class="notranslate"><span class="pl-c1">diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py</span>
index 4ecfb32..73daa6e 100644
<span class="pl-md">--- a/lib/mpl_toolkits/mplot3d/art3d.py</span>
<span class="pl-mi1">+++ b/lib/mpl_toolkits/mplot3d/art3d.py</span>
<span class="pl-mdr">@@ -266,6 +266,7 @@</span> class Patch3D(Patch):
         self._segment3d = [juggle_axes(x, y, z, zdir) \
                 for ((x, y), z) in zip(verts, zs)]
         self._facecolor3d = Patch.get_facecolor(self)
<span class="pl-mi1"><span class="pl-mi1">+</span>        self._facecolor2d = self._facecolor3d</span>
 
     def get_path(self):
         return self._path2d</pre></div>
<p dir="auto">The following minimal example demonstrates the issue:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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]
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()"><pre class="notranslate"><code class="notranslate">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]
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()
</code></pre></div>
<p dir="auto">It fails on the last line with the following traceback:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="AttributeError                            Traceback (most recent call last)
&lt;ipython-input-13-de0f41d662cd&gt; in &lt;module&gt;()
----&gt; 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):
--&gt; 636         return self._facecolors2d
    637     get_facecolor = get_facecolors
    638

AttributeError: 'Poly3DCollection' object has no attribute '_facecolors2d'"><pre class="notranslate"><code class="notranslate">AttributeError                            Traceback (most recent call last)
&lt;ipython-input-13-de0f41d662cd&gt; in &lt;module&gt;()
----&gt; 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):
--&gt; 636         return self._facecolors2d
    637     get_facecolor = get_facecolors
    638

AttributeError: 'Poly3DCollection' object has no attribute '_facecolors2d'
</code></pre></div>
<p dir="auto">Tested with mpl versions 1.3.1 and 1.4.2.</p>
<p dir="auto">Sent here by Benjamin, from the mpl users mailing list (mail with the same title). Sorry for dumping this without more assistance, I'm not yet at a python level where I can help in debugging, I think (well, it seems daunting).</p>