Reputation: 71
I'm trying to visualize a Gillespie algorithm with tsplot, however the points aren't connected since the set of time points are different for each replicate and treatment. Is there anyway to fix this? Here's code with the gammas example where I changed a time point:
import numpy as np; np.random.seed(22)
import seaborn as sns; sns.set(color_codes=True)
gammas = sns.load_dataset("gammas")
print(gammas)
print(gammas.iloc[3000,0])
print(gammas.iloc[3060,0])
gammas.iloc[3000,0]=5.050505050515
ax = sns.tsplot(time="timepoint", value="BOLD signal",unit="subject", condition="ROI",data=gammas,err_style='unit_traces')
Upvotes: 2
Views: 844
Reputation: 48992
The gap is happening because you end up with nans
in your data when there are "missing" observations at some timepoints. Try:
sns.tsplot(..., estimator=np.nanmean)
which for me with your example gives a solid line.
Upvotes: 2