title: Donut chart python
body: <p>So I using this code to create a donut chart with python (inspired in this Donut plot <a href="http://wwwu.edu.uni-klu.ac.at/mdragasc/codewiki/doku.php?id=pylabrecipes" rel="noreferrer">recipe</a>):</p>
  
  <pre><code>def make_pie(sizes, text,colors,labels):
      import matplotlib.pyplot as plt
      import numpy as np
  
      col = [[i/255. for i in c] for c in colors]
  
      fig, ax = plt.subplots()
      ax.axis('equal')
      width = 0.35
      kwargs = dict(colors=col, startangle=180)
      outside, _ = ax.pie(sizes, radius=1, pctdistance=1-width/2,labels=labels,**kwargs)
      plt.setp( outside, width=width, edgecolor='white')
  
      kwargs = dict(size=20, fontweight='bold', va='center')
      ax.text(0, 0, text, ha='center', **kwargs)
      plt.show()
  
  c1 = (226,33,7)
  c2 = (60,121,189)
  
  make_pie([257,90], "Gender (AR)",[c1,c2],['M','F'])
  </code></pre>
  
  <p>which results in:</p>
  
  <p><a href="https://i.stack.imgur.com/QCasE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QCasE.png" alt="enter image description here"></a></p>
  
  <p>My problem is that now I want the respective percentages. For that I was simply adding the argument: </p>
  
  <pre><code>autopct='%1.1f%%'
  </code></pre>
  
  <p>like this:</p>
  
  <pre><code>kwargs = dict(colors=col, startangle=180,autopct='%1.1f%%')
  </code></pre>
  
  <p>but this results in the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "draw.py", line 30, in &lt;module&gt;
      make_pie([257,90], "Gender (AR)",[c1,c2],['M','F'])
    File "draw.py", line 13, in make_pie
      outside, _ = ax.pie(sizes, radius=1, pctdistance=1-width/2,labels=labels,**kwargs)
  ValueError: too many values to unpack
  </code></pre>
  
  <p>So, what am I doing wrong?</p>