python - Matplotlib basemap drawcounties doesn't work -
pretty title says. drawcounties command being ignored no errors. plot on projections? documentation doesn't so.
import numpy np import matplotlib.pyplot plt mpl_toolkits.basemap import basemap, shiftgrid import scipy def basemapparameters(): """ sets basemap. """ m = basemap(projection='mill', llcrnrlon = 230, llcrnrlat = 27, urcrnrlat = 45, urcrnrlon = 261, area_thresh = 1000., resolution='i') m.drawcounties(linewidth=0.5) m.drawcoastlines(linewidth=0.7) m.drawcountries(linewidth=0.5) m.drawstates(linewidth=0.5) m.drawmapboundary(linewidth=0.7) def saveplot(lvl,parameter,region,hour,padding): """ saves figure file given properties """ plt.savefig('{0}_{1}_{2}_{3}.png'.format(lvl,parameter,region,hour),bbox_inches='tight',pad_inches = padding) plt.close("all") print(' "{0}_{1}_{2}_{3}.png" created.'.format(lvl,parameter,region,hour)) fig = plt.figure() ax = fig.add_subplot(1,1,1) basemapparameters() saveplot('sfc','3hrpcp','sw','000',.07)
drawcoastlines() plotting polygons white faces, going on top of county lines.
Comments
Post a Comment