使用此解决方案作为基础,是否可以创建多个从同一源发出到不同目标的箭头?例如德里 -> 北京 (116.4, 39.9),德里 -> 开罗 (30.0, 31.2),德里 -> 东京 (35.6, 139.6)?
当我重复下面的代码时,我只得到第一个箭头。
#Dehli - Beijing
ax.annotate('Beijing', xy=(116.4, 39.9), xycoords=transform,
size=40,
)
ax.annotate('Delhi', xy=(113, 40.5), xytext=(77.23, 28.61),
size=40,
arrowprops=dict(facecolor='red', ec = 'none',
arrowstyle="fancy",
connectionstyle="arc3,rad=-0.2",
),
xycoords=transform,
)
#Dehli - Cairo
ax.annotate('Cairo', xy=(-6.26, 53.34), xycoords=transform,
size=40,
)
ax.annotate('Delhi', xy=(113, 40.5), xytext=(77.23, 28.61),
size=40,
arrowprops=dict(facecolor='red', ec = 'none',
arrowstyle="fancy",
connectionstyle="arc3,rad=-0.2",
),
xycoords=transform,
)
或者,有没有办法将 .annotate 放入我目前用来绘制连接线的表达式中。我试过无济于事:
#Coordinates
lon_dehl, lat_dehl = 116.4, 39.9
lon_beij, lat_beij = 77.59, 12.97
lon_toky, lat_toky = 35.6, 139.6
lon_cair, lat_cair = 30.0, 31.2
plt.plot([lon_dehl, lon_beij], [lat_dehl, lat_beij],
linewidth=2,
linestyle='solid',
solid_capstyle='round',
color='#cb2c31',
marker='o',
markersize=6,
markeredgewidth=None,
markeredgecolor='#cb2c31',
transform=ccrs.PlateCarree(),
)