title: refresh my piechart using matplotlib?
body: <p>I have a piechart drawn using matplotlib. Alongside this pie chart i have a slider, which when pressed will invoke a handler. I would like this handler to change the values of piechart. So for example, if the pie chart has labels 60% and 40% respectively, i would like the labels to be modified to 90% and 10% upon the slider being pressed. Here is the code:</p>
  
  <p>This draws the pie chart and slider:</p>
  
  <pre><code>plt.axis('equal');
  explode = (0, 0, 0.1);
  plt.pie(sizes, explode=explode, labels=underlyingPie, colors=colorOption,
          autopct='%1.1f%%', shadow=True, startangle=90)
  plt.axis('equal')
  
  a0 = 5;
  axcolor = 'lightgoldenrodyellow'
  aRisk  = axes([0.15, 0, 0.65, 0.03], axisbg=axcolor)
  risk = Slider(aRisk, 'Risk', 0.1, 100.0, valinit=a0)
  risk.on_changed(update);
  </code></pre>
  
  <p>and the following is the event handler, the desired functionality is to modify labels and redraw the pie chart</p>
  
  <pre><code>def update(val):
      riskPercent = risk.val;
      underlyingPie[0] = 10;
      underlyingPie[1] = 90;
      plt.pie(sizes, explode=explode, labels=lab, colors=colorOption,
          autopct='%1.1f%%', shadow=True, startangle=90)
  </code></pre>
  
  <p>i am also drawing the below, can i get both the pie chart and the below on the same canvas?</p>
  
  <pre><code>fig = plt.figure();
  ax1 = fig.add_subplot(211);
  
  for x,y  in zip(theListDates,theListReturns):
      ax1.plot(x,y);
  
  plt.legend("title");
  plt.ylabel("Y axis");
  plt.xlabel("X axis");
  plt.title("my graph");
  </code></pre>
  
  <p>thanks in advance</p>