Как указать поле со стрелкой на основе географических координат на Базовой карте? - PullRequest
1 голос
/ 31 января 2020

Я пытаюсь нарисовать поле со стрелкой для указания c координат, но это не точно. Головка стрелки должна указывать на точку, которая создается разбросом. как я могу решить проблему? Вот мой код:

fig, axes = plt.subplots(figsize=(15, 15))
m = Basemap(projection='merc',
               llcrnrlat = 39, 
               urcrnrlat = 59,
               llcrnrlon = -10,
               urcrnrlon = 45,
               resolution='l',lat_0 = 58.9, lon_0 = 25.3,
               ax=axes)
m.drawcoastlines(linewidth=0.9)
m.drawcountries(color='blue')
m.drawmapboundary(fill_color='aqua')
m.fillcontinents(color='lightgreen')

# x, y = m(51, 4, inverse=True)
# x2, y2 = m(50, 6, inverse=True)
bbox1 = dict(boxstyle='{},pad={}'.format('rarrow', 1), fc='green', ec='green', lw=5)
axes.annotate('text',xy=m(cities['LOCATION x'].iloc[0], cities['LOCATION y'].iloc[0]) , xycoords='data', rotation=20, ha='right', va='bottom', color='black',
                     xytext=(cities['LOCATION x'].iloc[0], cities['LOCATION y'].iloc[0]), textcoords='offset points', fontsize=10, weight=1000,
                    bbox=bbox1,)
m.scatter(cities['LOCATION x'].iloc[0], cities['LOCATION y'].iloc[0], latlon=True, s=200,
                  marker='o', alpha=1, zorder=2, color='blue')
plt.show()

enter image description here

...