我正在使用文森特为美国绘制县级地图。以 2016 年选举的数据为例。然而,它并不适用于加利福尼亚等一些州。我检查了数据,FIPS 代码似乎存在,但仍然显示为空白。任何想法可能会发生什么?我从 topo.json 获得了县级数据。
geo_data_c2 = [{'name': 'counties',
'url': county_topo,
'feature': 'us_counties.geo'}]
vis_election_counties = vincent.Map(data=merged, geo_data=geo_data_c2, scale=1000,
projection='albersUsa', data_bind='per_dem',
data_key='combined_fips', map_key={'counties': 'properties.FIPS'})
#Change our domain for an even inteager
vis_election_counties.scales['color'].domain = [0,1]
vis_election_counties.legend[![enter image description here][1]][1](title='per_dem')
vis_election_counties.to_json('vega.json')
vis_election_counties.display()