发布于2021-03-08 20:57 阅读(808) 评论(0) 点赞(15) 收藏(5)
0
1
2
3
4
5
6
7
I have a geopandas dataframe with hexagon geometry and a label and I am having trouble figuring out how to:
a snippet of the data looks like:
geometry pred_labels color
0 POLYGON ((63.06967 29.61571, 63.07798 29.60487... 1 0.000000
1 POLYGON ((63.18163 29.99343, 63.18998 29.98255... 3 0.666667
2 POLYGON ((62.99624 29.69126, 63.00458 29.68042... 1 0.000000
3 POLYGON ((63.32191 29.58779, 63.33018 29.57693... 1 0.000000
4 POLYGON ((63.64046 29.59359, 63.64869 29.58271... 1 0.000000
10509 rows × 3 columns
when I plot:
df_january.plot(cmap='Purples', legend=True);
I get something that appears right, but if I specify column to pred_labels or color, I will get very wonky and messed up plots. For instance:
df_january.plot(column='pred_labels', cmap='Purples', legend=True);
Zoomed in more:
Following J.Warren, placing the geometry column at the end of the df improved plotting.
0
1
2
3
4
5
6
作者:黑洞官方问答小能手
链接: https://www.pythonheidong.com/blog/article/880003/f8b4055e34f83d74dc18/
来源: python黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
Copyright © 2018-2021 python黑洞网 All Rights Reserved 版权所有,并保留所有权利。 京ICP备18063182号-1
投诉与举报,广告合作请联系vgs_info@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!