python - 使用注释后 Matplot lib 不稳定
问题描述
我想知道是否有人可以发现我可能做错了什么,导致我在 Jupyter Labs 的情节中出现这种有点不稳定的行为。
我正在使用以下代码在地图上注释匀称点:
ax = gdf_2[gdf_2['Zone'] == 'ULEZ'].plot()
gdf_2.apply(lambda x: ax.annotate(s=x.pod_id_location, xy=x.loc['geometry'].coords[0]), axis=1)
ctx.add_basemap(ax=ax)
plt.axis('off')
plt.show()
出于某种原因,虽然这确实产生了我的情节,但它在笔记本上打印得很小。如果我尝试增加图形大小,有时会收到警告说我超出了像素限制,有时会导致内核死机。这就是我的情节的样子,下面是我背后的数据。
pod_id_location geometry Zone
0 1245 POINT (-22993.152 6728924.970) non-ULEZ
7940 2245 POINT (-13406.652 6714132.654) ULEZ
13934 3245 POINT (-16958.244 6720147.066) non-ULEZ
25068 5245 POINT (-20791.698 6699568.057) non-ULEZ
32551 6245 POINT (-40049.413 6704610.464) non-ULEZ
... ... ... ...
849223 742451 POINT (-12923.302 6720129.538) non-ULEZ
849547 832450 POINT (-6445.287 6717978.299) non-ULEZ
851190 872450 POINT (-4064.943 6697346.893) non-ULEZ
852852 892450 POINT (6744.514 6713063.033) non-ULEZ
853523 982450 POINT (-958.349 6706975.535) non-ULEZ
解决方案
推荐阅读
- java - 使用 java 链接 XML 和 XSD
- gcc - 是否可以在 Conda 环境中使用不同的 gcc 版本?
- node.js - ejs@3.1.3 postinstall: `node --harmony ./postinstall.js 退出状态1
- sql - 从一个巨大的数据库中循环一个 SQL QUERY 来做增量数据拉取
- css - 将 1 个孩子左对齐,其余的在 div 中右对齐
- c# - WPF如何使用MVVM清除列表视图中的texbox内容
- matplotlib - 为 seaborn 计数图中的所有条形应用单一颜色
- git - 实际上删除 git commit 的方式是它会从日志中消失
- angular - Angular9 中的当前用户信息
- python - 将 list 类型的 pandas 列转换为 dict