我得到了一个包含以下列名称(字符串)、大小(num)、纬度(num)、经度(num)、几何(shapely.geometry.point.Point)的数据框。
当我在地图上绘制我的点并尝试注释每个点时,根本不会显示注释。我的猜测是这是由于我使用的投影。
这是我正在运行的代码行:
import geopandas as gpd
import geoplot as gplt
proj = gplt.crs.AlbersEqualArea()
fig, ax = plt.subplots(figsize=(10, 10), subplot_kw={'projection': proj})
gdf = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df.longitude, df.latitude))
gplt.pointplot(gdf, hue='size', s=15, ax=ax, cmap=palette, legend=True, zorder=10)
for idx, row in gdf.iterrows():
plt.annotate(s=row['Name'], xy=[row['latitude'],row['longitude']])
plt.show()