Python 在Altair中的每个镶嵌面子地块中显示x和y标签
我指的是: 这将生成一个包含3个子地块的绘图,其中x轴和y轴共享。我希望每个子地块都有自己的x和y标签(即使重复)。如何实现这一点?您可以使用以下内容中讨论的方法实现这一点:Python 在Altair中的每个镶嵌面子地块中显示x和y标签,python,altair,Python,Altair,我指的是: 这将生成一个包含3个子地块的绘图,其中x轴和y轴共享。我希望每个子地块都有自己的x和y标签(即使重复)。如何实现这一点?您可以使用以下内容中讨论的方法实现这一点: import altair as alt from vega_datasets import data iris = data.iris() alt.Chart(iris).mark_point().encode( x='petalLength:Q', y='petalWidth:Q', col
import altair as alt
from vega_datasets import data
iris = data.iris()
alt.Chart(iris).mark_point().encode(
x='petalLength:Q',
y='petalWidth:Q',
color='species:N'
).properties(
width=180,
height=180
).facet(
facet='species:N',
columns=2
)
import altair as alt
from vega_datasets import data
iris = data.iris()
alt.Chart(iris).mark_point().encode(
x='petalLength:Q',
y='petalWidth:Q',
color='species:N'
).properties(
width=180,
height=180
).facet(
facet='species:N',
columns=2
).resolve_axis(
x='independent',
y='independent',
)