python - Matplotlib Mollweide/Hammer projection: region of interest only -
i wondering if there's way show region of interest plot based on mollweide/hammer projection in basemap (matplotlib).
i trying set plot-bounds pacific plate, in link below. however, set_xlim , set_ylim functions not seem have effect. in advance guidance.
from documentation, both hammer
, mollweide
projections don't allow print out entire world maps. here's code using polyconic
projection, bounded straight lines. trick here define corner longitude , latitudes on creation.
from mpl_toolkits.basemap import basemap import matplotlib.pyplot plt import numpy np my_map = basemap(projection='poly', lat_0=0, lon_0=-160, resolution = 'h', area_thresh = 0.1, llcrnrlon=140, llcrnrlat=-60, urcrnrlon=-100, urcrnrlat=60) plt.figure(figsize=(16,12)) my_map.drawcoastlines() my_map.drawcountries() my_map.fillcontinents(color='coral', lake_color='aqua') my_map.drawmapboundary(fill_color='aqua') my_map.drawmeridians(np.arange(0, 360, 20)) my_map.drawparallels(np.arange(-90, 90, 10)) plt.show()
result:
note shows less area 1 in picture provided.
Comments
Post a Comment