I am trying to plot the data the between quantiles and so far I have only managed to create a plot with the area being to 0.
Here's my attempt so far which has the 25th and 75th percentiles, but unfortunately shades the entire region to the X axis, whereas I would like the shading to go between them.
import altair as alt
from vega_datasets import data
source = data.cars()
base = alt.Chart(source).encode(alt.X("Year:T", title="Year"))
base.transform_quantile(
"Miles_per_Gallon", probs=[0.25, 0.75], groupby=["Year"]
).mark_area(opacity=0.2).encode(alt.Y("value:Q", stack=None), alt.Color("prob:N"))
I was trying to use alt.Y and alt.Y2 in the encoding for the area, but I could not find how to specify the desired probabilities. Note that I need this solution to work for any quantile (not just special ones like the 25th, 50th and 75th percentiles).
