Using python: I have a sequence of data points with means and a list with the standard deviation for each mean. I would like to plot the means as points connected by a solid line and the standard deviation as an halo around the line using the same color, but changed opacity and the width of the halo as an indication of the size of std. There is one plot which looks exactly like this: the time series plot in Seaborn and the Continuous Error Bars in Plotly: but the data model in the first is not suitable for my data as far as I can see and the output solution of the second is suboptimal for me. I haven't found a simple solution in Matplotlib. Obviously I could solve this by plotting the data points as lines from point to point and the std as a series of tetragons with different opacity. But maybe there is a more comfortable solution out there. Thanks in advance!
ps: my data looks like this:
means = [3, 5, 1, 8, 4, 6]
stds = [1.3, 2.6, 0.78, 3.01, 2.32, 2.9]
Just do :
plt.plot (means)
plt.fill_between(range(6),means-stds,means+stds,alpha=.1)
For
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With