Show average instead of median in boxplot When plotting a boxplot with python matplotblib, the lines halfway the plot is the median of the distribution.
Is there a possibility to instead have the line at the average. Or to plot it next to it in a different style.
Also, because it is common for the line to be the median, will it really confuse my readers if I make it the average (off course I will add a note what the middle line is)?
 A: This code makes the boxplots then places a circle marking the mean for each box.  You can use a different symbol by specifying the marker argument in the call to scatter.
import numpy as np
import pylab

# 3 boxes
data = [[np.random.rand(100)] for i in range(3)]
pylab.boxplot(data)

# mark the mean    
means = [np.mean(x) for x in data]
pylab.scatter([1, 2, 3], means)


A: To answer your second question: Yes, I think it will be confusing to put the line at the mean instead of the median. The precise rules controlling the length of the 'whiskers' (if any) and treatment of outliers vary, but everyone keeps to Tukey's use of the box as displaying the median and lower and upper quartiles. For highly skew distributions, the mean could be outside the box, which would look very odd. Common usage is that the median goes with the interquartile range, while the mean goes with standard deviation (or standard error of the mean if you're interested in inference rather than data description). If you want to show the mean visually, i'd use a different symbol to display it to avoid confusion. 
