title: Panda: how to assign colors to specific values on a pie chart?
body: <p>I would like to assign a color to each discrete value in order to plot different pie charts by keeping the same color for each value.</p>
  <p>Let's say we have to pandas dataframes <code>df1</code> and <code>df2</code></p>
  <pre><code>df1
         val
  20.0    14
  30.0    22
  40.0    12
  50.0    15
  60.0    2
  80.0    2
  90.0    3
  220.0   1
  230.0   1
  </code></pre>
  <p>and</p>
  <pre><code>df2
         val  
  20.0    31
  30.0    19
  40.0    31
  50.0    30
  80.0    1
  90.0    1
  110.0   6
  160.0   14
  220.0   57
  230.0   1
  
  
  f,ax=plt.subplots(1,2,figsize=(10,5))
  df1.plot.pie(y='val', ax=ax[0])
  df2.plot.pie(y='val', ax=ax[1])
  </code></pre>
  <p><a href="https://i.stack.imgur.com/0feBt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0feBt.png" alt="enter image description here" /></a></p>
  <p>I would like to map the colors from a dictionary like the following</p>
  <pre><code>color_mapping1 = {0: &quot;black&quot;, 20:'#FFBB22', 30:&quot;#FFFF4C&quot;, 40:&quot;#F096FF&quot;, 50:&quot;#FA0000&quot;, 60:&quot;#B4B4B4&quot;,
                   70:&quot;#F0F0F0&quot;, 80:&quot;#0032C8&quot;, 90:&quot;#0096A0&quot;, 100:&quot;#FAE6A0&quot;, 110:'#58481F', 
                   120:&quot;#009900&quot;, 130:&quot;#70663E&quot;, 140:&quot;#00CC00&quot;, 150:&quot;#4E751F&quot;, 160:&quot;#007800&quot;, 
                   170:&quot;#666000&quot;, 180:&quot;#8DB400&quot;, 190:&quot;#8D7400&quot;, 200:&quot;#A0DC00&quot;, 210:&quot;#929900&quot;,
                   220:&quot;#648C00&quot;, 230:&quot;#000080&quot;}
  </code></pre>