1

この 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)

y と y2 を固定した plot_rect

4

1 に答える 1