title: matplotlib: filled boxplot and point display
body: <p>I want to display box plots that are filled with a color, and also allow me to display a point (the average values of each data set) on top of them.</p>
  
  <p>Until now I only succeded to display the unfilled bars with the average points on them:</p>
  
  <pre><code>import numpy as np
  import pandas as pdK
  import matplotlib.pyplot as plt
  from matplotlib import rcParams
  %matplotlib inline
  
  X = np.random.rand(20)
  Y = np.random.rand(20)
  Z = np.random.rand(20) 
  X_ave=np.mean(X)
  Y_ave=np.mean(X)
  Z_ave=np.mean(X)
  plt.boxplot([X,Y,Z], patch_artist=False)
  plt.plot(1, X_ave,'*', markersize=15)
  plt.plot(2, Y_ave,'*', markersize=15)
  plt.plot(3, Y_ave,'*', markersize=15)
  #plt.boxplot(box_plot_data)
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/FBPw9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FBPw9.png" alt="unfilled_boxPlots"></a></p>
  
  <p>Once I fill  the box plots by setting patch_artist=True, the average values are overriden by the color of the boxes and are not shown anymore.</p>
  
  <pre><code>X = np.random.rand(20)
  Y = np.random.rand(20)
  Z = np.random.rand(20) 
  X_ave=np.mean(X)
  Y_ave=np.mean(X)
  Z_ave=np.mean(X)
  plt.plot(1, X_ave,'*', markersize=15)
  plt.plot(2, Y_ave,'*', markersize=15)
  plt.plot(3, Y_ave,'*', markersize=15)
  plt.boxplot([X,Y,Z], patch_artist=True)
  #plt.boxplot(box_plot_data)
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xVfdq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xVfdq.png" alt="filled_boxPlots"></a></p>