title: Matplotlib : How can I draw a circle with a gradient face color
body: <p>How can I draw circles with different color gradients, that are high at the center of the circle and low towards its borders? </p>
  
  <p>I can draw, say, 3 circles with different facecolors, using the following code -</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.patches as patches
  
  ellipse1 = patches.Ellipse(xy=(0, 0), width=4, height=4, angle=30, color='r', alpha=0.4)
  ellipse2 = patches.Ellipse(xy=(-2, -2), width=4, height=4, angle=30, color='g', alpha=0.4)
  ellipse3 = patches.Ellipse(xy=(3, -2), width=4, height=4, angle=30, color='b', alpha=0.4)
  
  fig, ax = plt.subplots() 
  ax.set_xlim((-5, 5))
  ax.set_ylim((-5, 5))
  
  ax.add_patch(ellipse1)
  ax.add_patch(ellipse2)
  ax.add_patch(ellipse3)
  
  plt.show()
  </code></pre>
  
  <p>So I get the following output -</p>
  
  <p><a href="https://i.stack.imgur.com/XHYCY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XHYCY.png" alt="3 flat color cirlces"></a></p>
  
  <p>I want to color the circles with red, green and blue color gradients instead, that are high at the center and low at the borders. </p>
  
  <p>Is there a minimal way to change the existing code to do that?</p>