我想用geopandas绘制一个shapefile
。我想根据shapefile
中的属性获得线条的厚度。我正在为此使用以下命令:
shp_sub.plot(column='Case1_2', cmap='BuGn', figsize=(5,5), linewidth=shp_sub['Case1_2'], edgecolor='0.8', vmin=0, vmax=1)
这意味着厚度和色码应相互匹配
我试过这个:
shp_sub.plot(column='Case1_2', cmap='BuGn', figsize=(5,5), linewidth=1, edgecolor='0.8', vmin=0, vmax=1)
当我尝试这个时,我没有得到一对一的答案
shp_sub.plot(column='Case1_2', cmap='BuGn', figsize=(5,5), linewidth=shp_sub['Case1_2'], edgecolor='0.8', vmin=0, vmax=1)
看起来您的“Case1_2”属性不是数字,或者在有意义地更改线宽的范围内不是数字。您可能只对0到15之间的线宽感兴趣。如果创建基于数字的新属性(例如,基于流顺序),则使用列值设置线宽应该有效
或者,可以将现有列中的一列缩放到有用的线宽范围内:
相关问题 更多 >
编程相关推荐