この Highcharts の例のように、Altair は y 軸にバンドをプロットできますか?
ドキュメントには、y 軸上に線を描画する方法を示す例plot_rect
がありますが、代わりにバンドを描画するために使用する例を適応させることはうまくいきません:
import altair as alt
from vega_datasets import data
weather = data.seattle_weather.url
chart = alt.Chart(weather).encode(
alt.X("date:T")
)
bars = chart.mark_bar().encode(
y='precipitation:Q'
)
band = chart.mark_rect().encode(
y=alt.value(20),
y2=alt.value(50),
color=alt.value('firebrick')
)
alt.layer(bars, band)