I would like to use lineplot with its nice error bands.Unfortunately this only works when multiple data points are at the samex position. I often have measured timeseries data, so x is increasing slowly and never the same.
Currently, I worked around this problem by using panda's df.rolling():
# moving average
rolling = df['y'].rolling(30, center=True)
ma = rolling.mean()
plt.plot(df['x'], ma, linewidth=2)
# standard derivation bands
mstd = rolling.std()
plt.fill_between(df['x'], ma-2*mstd, ma+2*mstd, alpha=0.2)
It would be nice, if you could add a parameter to lineplot() which mimics this behavior.
I would like to use
lineplot
with its nice error bands.Unfortunately this only works when multiple data points are at the samex
position. I often have measured timeseries data, sox
is increasing slowly and never the same.Currently, I worked around this problem by using panda's
df.rolling()
:It would be nice, if you could add a parameter to
lineplot()
which mimics this behavior.