我正在尝试使用altair python可视化库,并获得了facet函数。然而,在图中,所有的面都有相同的y-lim。我想知道是否有可能实现类似于ggplot2的方面(~column,scale= "free")。有没有办法在altair中实现scales ==“免费”?我查看了文档,发现没有其他我可以调整的变量。
我使用的代码如下:
alt.Chart(sum_tf).mark_line().encode(
x='month:Q',
y='value:Q',
).properties(
width=600,
height=100
).facet(
facet='variable:O',
columns=1
)发布于 2019-10-24 09:50:31
您可以使用resolve_scale设置来控制复合图表中的比例是共享的还是独立的。默认情况下,比例是共享的:
alt.Chart(sum_tf).mark_line().encode(
x='month:Q',
y='value:Q',
).properties(
width=600,
height=100
).facet(
facet='variable:O',
columns=1
).resolve_scale(
y='independent'
)在这里的文档中有更多的信息和例子:https://altair-viz.github.io/user_guide/scale_resolve.html
https://stackoverflow.com/questions/58531937
复制相似问题