I have a time-series with uniform samples save to a numpy array and I'd like to plot their mean value with a bootstrapped confidence interval. Typically, I've used tsplot
from Seaborn to accomplish this. However, this is now being deprecated. What am I supposed to use a replacement?
Here is an example usage below adapted from the Seaborn documentation:
x = np.linspace(0, 15, 31)
data = np.sin(x) + np.random.rand(10, 31) + np.random.randn(10, 1)
sns.tsplot(data)
Note: this is similar to questions "Seaborn tsplot error" and "Multi-line chart with seaborn tsplot". However, in my case, I actually need the confidence interval functionality of Seaborn and thus cannot simply use Matplotlib without some awkward coding.
The replacement for
tsplot
calledlineplot
was introduced in version0.9.0
. It doesn't support Numpy-like "wide-form" data, thus the data has to be transformed using Pandas.The example
tsplot
from the question can easily be replicated using matplotlib.Using standard deviation as error estimate
Using bootstrapping for error estimate
I guess the reason this is deprecated is exactly that the use of this function is rather limited and in most cases you are better off just plotting the data you want to plot directly.