title: How to show filtered legend labels in pyplot pie chart based on the values of contributions?
body: <p>I would like to plot a pie chart that shows contributions that are more than 1%, and their corresponding legend label. </p>
  
  <p>I have managed showing the percentage values I wanted on the pie (see script below), but not the legend labels. In the following example, I want to show legend labels ABCD, but not EF.</p>
  
  <p>I have tried several things, but only able to show either a full legend, or a filtered legend with unmatched (wrong) colors. </p>
  
  <p>How can I do this? Can someone help? Thanks.</p>
  
  <pre><code>sizes = pd.DataFrame([80,10,5,4,0.1,0.9],index=list("ABCDEF"))
  
  fig1, ax2 = plt.subplots()
  
  def autopct_more_than_1(pct):
      return ('%1.f%%' % pct) if pct &gt; 1 else ''
  
  ax2.pie(sizes.values, autopct=autopct_more_than_1)
  ax2.axis('equal') 
  
  plt.legend(sizes.index, loc="best", bbox_to_anchor=(1,1))
  
  plt.show()
  </code></pre>