4

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

mcatis
  • 1,176
  • 4
  • 11
  • 24
  • I have tried to make more than 1000 figures using basemap, and it's pretty fast. you can loop the data with the same map set, different timestamp. If you want to use .tiff or some file as the background, it may become a little slow. Only read shapefile(polygon) would not cost much time – Han Zhengzu Dec 30 '15 at 09:43
  • you can give the detail about your target and your data structure, I'll help you if I can. – Han Zhengzu Dec 30 '15 at 09:47

0 Answers0