简体   繁体   中英

Get band values when using seaborn lineplot with ci parameter

I want to get the bounding values when I use seaborn lineplot with the parameter ci set to sd eg

import seaborn as sns; sns.set()
import matplotlib.pyplot as plt
fmri = sns.load_dataset("fmri")
ax = sns.lineplot(x="timepoint", y="signal", ci="sd", data=fmri)

It returns the axes object with the plot draw onto it, but how do I get the numeric values of the estimator and the bands corresponding to sd ?

sns.lineplot() is plotting the mean of fmri.signal at each value of fmri.timepoint and adding confidence intervals by standard deviation. You can get the mean and standard deviation with native Pandas:

fmri.groupby('timepoint')['signal'].mean()
fmri.groupby('timepoint')['signal'].std()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM