I want to have a contour plot where different color bands represent different confidence intervals of a line plot. consider the code below from this page:
import seaborn as sns; sns.set()
import matplotlib.pyplot as plt
fmri = sns.load_dataset("fmri")
ax = sns.lineplot(x="timepoint", y="signal", data=fmri)
which results in:
Fig.1 - image courtesy of pydata.org.
now if I'm not mistaken those error bands represent a confidence band (e.g. 95%). What I want is to have different confidence intervals (e.g. given a list like [50, 60, 70, 80, 90]
) represented as a contour plot around the centerline.
P.S.1. It doesn't have to be seaborn or even matplotlib for that matter. Even non-Python solutions are also ok for me as far as it is Free, Libre and Open Source Software (FLOSS).
P.S.2. I think the solution should include the ci
parameter of the lineplot
function. Maybe I can have a for loop going over the list above and plot different confidence intervals on top of each other?
P.S.3. So far I have realized that putting the last line of the above code inside a for loop
over the mentioned list of confidence intervals would plot them on top of each other:
for ii in [10, 50, 90]:
ax = sns.lineplot(x="timepoint", y="signal", data=fmri, ci=ii)
Fig.2 - putting the plotting command in a for loop.
However, I don't know how to control the hue/color-map of those transparent bands and don't know how to add a legend based on those values.