【发布时间】:2021-02-04 15:00:01
【问题描述】:
我目前正在使用纽约市的地理数据框。但是,我希望我的图表只显示城市的特定部分。有没有办法在 mark_geoshape 中设置纬度和经度的最大值和最小值?
我希望我的图表仅显示从纬度 40.64 到 40.84 和经度 -74.01 到 -73.9。
这是我当前的代码:
ntaMap = alt.Chart(ntaData).mark_geoshape(
fill='whitesmoke',
stroke='gray',
strokeWidth=0.5
).encode(
tooltip=['NTAName','BoroName']
).properties(
width=500,
height=500,
title='Neighborhood Tabulation Areas'
).configure_view(
strokeWidth=0
)
ntaMap
谢谢!
【问题讨论】:
-
我确实在
encode- altair-viz.github.io/user_guide/generated/toplevel/… 下看到了latitude和longitude的参数