问题
Plotting a very, very simple map of only europe in matplotlib / basemap takes so much time (around 10 seconds!). This is just unreal!? Setting of resolution is only "l" (low).
Here is the very simple code:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
m = Basemap(projection='stere',lon_0=5,lat_0=90.0,rsphere=6371200.,\
llcrnrlon=-25.0,urcrnrlon=72.0,llcrnrlat=26.0,urcrnrlat=65.0,resolution='l')
m.drawcoastlines(linewidth=0.2)
m.drawcountries(linewidth=0.2)
plt.savefig('/var/www/map.png')
I need to plot hundreds of these maps every 2 hours. This would be impossible? :( Only idea is: Create an empty Basemap and try to draw boundaries with a shapefile.
Regards, John
来源:https://stackoverflow.com/questions/28127331/plotting-a-map-with-matplotlib-basemap-horribly-slow