下面是我试图可视化的数据示例
Prince Edward Island 2.333
Manitoba 2.529
Alberta 2.6444
British Columbia 2.7902
Saskatchewan 2.9205
Ontario 3.465
New Brunswick 3.63175
Newfoundland and Labrador 3.647
Nova Scotia 4.25333333333
Quebec 4.82614285714
Nunavut NaN
Yukon NaN
Northwest Territories NaN
我想通过根据每个省与之相关联的数字给每个省着色来可视化数据。当我这样做时,Nan的颜色就像colormap的最小值一样。有没有一种简单的方法可以将Nan映射为白色?在
这是我的代码:
^{pr2}$
您可以合并两层:
查看geopandas文档,了解使用
matplotlib
对象的替代方法。在相关问题 更多 >
编程相关推荐