I'm comparing several histogram together, to evaluate the variance over the years:
The problem is that, while it shows the variance, it is hard to discern one type from another. I'm wondering what would be a better way to make this plot?
Those bars are not really stacked but overlapped. You can stack them by doing:
import matplotlib.pyplot as plt
import numpy as np
mu, sigma = 0,100
x1 = mu + sigma*np.random.randn(1000)
x2 = mu + sigma*np.random.randn(1000)
x3 = mu + sigma*np.random.randn(1000)
#Stack the data
plt.figure()
plt.hist([x1,x2,x3], bins=30, stacked=True, normed = True)
plt.show()
, which will result in this:
However to perceive a quantile variability in different distributions the boxplot is usually more adequate:
plt.boxplot([x1,x2,x3])
plt.show()
, results in:
You can also take a look into plots such as Probability Plot, or StackPlot. If you really need to compare the variance value (and not just the distribution globally) you can plot the lines for variance (or standard deviation if the order of magnitude is big) over your plots.
stack. It should be overlap. The boxplot would lose the histogram shape, which I think is really important here.alpha) makes it hard to discern one from another.