title: Matplotlib: 3D Scatter plots not recognizing labels
body: <p>I believe a similar question to this was asked before, but it didn't really clarify things for me.</p>
  
  <p>Basically, I have a list of tuples, each of which functions as a point (so (x, y, z) for example).</p>
  
  <p>I want to plot them in either 2D or 3D after I run a clustering algorithm (that color codes the points).</p>
  
  <pre><code>clusters = []
  def plotPoints(self):
      fig = plt.figure()
      if self.clusters[0].dimensions == 2:
          ax = fig.add_subplot(111)
          for i in range(0, len(self.clusters)):
              ax.scatter(*zip(*self.clusters[i].points), c=self.clusters[i].color, marker="o", label=("Cluster " + str(i + 1)))
          plt.legend(loc='upper left')
          plt.show()
      elif self.clusters[0].dimensions == 3:
          ax = fig.add_subplot(111, projection='3d')
          for i in range(0, len(self.clusters)):
              ax.scatter(*zip(*self.clusters[i].points), c=self.clusters[i].color, marker="o", label=("Cluster " + str(i + 1)))
          plt.legend(loc='upper left')
          plt.show()
      else:
          print "Cannot plot in dimensions lower than 2 or higher than 3"
  </code></pre>
  
  <p>Cluster class:</p>
  
  <pre><code>class Cluster(object):
  centroid = ()
  dimensions = 0
  color = 'k'
  
  def __init__(self, init_pt, color):
      self.points = []
      self.points.append(init_pt)
      self.dimensions = len(init_pt)
      self.centroid = init_pt
      self.color = color
  
  def addPoint(self, pt):
      try:
          if len(pt) != self.dimensions:
              raise ArithmeticError("Wrong number of dimensions on new point, ignoring")
          else:
              centroid_dim_list = []
              for dim in range(0, self.dimensions):
                  centroid_dim_list.append((self.centroid[dim] * len(self.points) + pt[dim]) / float(len(self.points) + 1))
              self.centroid = tuple(centroid_dim_list)
              self.points.append(pt)
      except ArithmeticError as ae:
          print ae.message
          pass
  </code></pre>
  
  <p>2D plots work just fine (and look really nice), but 3D plots give me a warning:</p>
  
  <pre><code>UserWarning: No labeled objects found. Use label='...' kwarg on individual plots.
    warnings.warn("No labeled objects found. "
  </code></pre>
  
  <p>And no legend appears. But I am labeling the points, and the code I am using is almost identical, so I am confused as to what the problem is. I heard something about a proxy object, but I have no clue how to use that for this case.</p>