I am trying to plot data from a longform pandas dataframe. When I try to plot the data using seaborn lineplot I get a weird result. Instead of plotting the mean for each x (timepoint) value I get a spikey plot.
my code is:
import seaborn as sns
fig,ax1 = plt.subplots(figsize=(25,7))
sn = sns.lineplot(data=data_test,x="Timepoint",y="value",estimator = None,hue = 'Filename')
fig,ax1 = plt.subplots(figsize=(25,7))
sn = sns.lineplot(data=data_test,x="Timepoint",y="value",marker='o',estimator = 'mean')
Below are examples of the plots I get. The upper one is the individual values which are correct. The lower one should show the mean and confidence intervals of these values, but it is wrong.
Example plots from this code
#Here is an example dataset:
https://docs.google.com/spreadsheets/d/18LHD3dKfkXMvlqxp74uXQqVpHsGHIrtJUucxDMPFt4I/edit?usp=sharing
question from:
https://stackoverflow.com/questions/66050604/seaborn-lineplot-not-plotting-means-correctly 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…