1

Suppose I want to plot 'text' on a basemap over Spain, this would work.

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt


m = Basemap(resolution='l')
fig = plt.figure(figsize=(12,10))
m.drawcoastlines(linewidth=0.5)
plt.annotate('Text',xy=(0,40),ha="center")
plt.show()

But it doesn't work on Merc view, no matter what x/y value I specify. E.g:

m = Basemap(projection='merc',resolution='c',llcrnrlat=36,llcrnrlon=-20,urcrnrlat=61,urcrnrlon=33)
fig = plt.figure(figsize=(12,10))
m.drawcoastlines(linewidth=0.5)
plt.annotate('Text',xy=(0,40),ha="center")
plt.show()

Will only show the text in the very bottom left. How to plot text in this view?

J W
  • 617
  • 1
  • 9
  • 28
  • Okay, plt.annotate('Text',xy=(2000000,4000000),ha="center") works so it seems to be using meters from some point. How do I use degree co-ordinates? – J W Aug 08 '16 at 13:54
  • 2
    SOLVED: xpt,ypt = m(x,y) (convert degree to m coordinates) – J W Aug 08 '16 at 15:41

0 Answers0