I'm trying to do some plots of data on a basemap of Australia using matplotlib-Basemap. I'm finding the interface for creating the basemap to be tricky. Specifically, I have lat/lon definitions for the Australian region (including Tasmania), but the map set up using the Basemap API excludes parts of the desired region. Here's a small sample code, which invokes matplotlib-Basemap's Basemap with the BoM's LCC projection parameters. If you run this, you'll find the northern portion of the Cape York Peninsula and the western portion of WA are missing. I'm hoping to do this automatically for Australia and for two of its states for which the standard map projection is also LCC (Tasmania and Victoria).
How can I get a basemap that will have as a guarantee that it contains all of a lat/lon region defined by a lat/lon bounding box?
import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap """ Equatorial/Polar minor radii for WGS84 ellipsoid approximation of the geoid """ rEquat = 6378137.00 rPolar = 6356752.3142 """ Standard latitudes for LCC projection. Used in this projection by Australia's BoM. """ trueLat1 = -10. trueLat2 = -40. """ lower-left/upper-right corners for the Australian domain. """ ozMinLat = -43.575 ozMinLon = 112.925 ozMaxLat = -10.075 ozMaxLon = 153.575 """ Central lat/lon coordinates. """ centerLat = 0.5 * (ozMinLat + ozMaxLat) centerLon = 0.5 * (ozMinLon + ozMaxLon) """ CASE 1: BoM's projection parameters. Cuts off W. edge of WA and N end of Cape York Peninsula. """ m = Basemap(llcrnrlon=ozMinLon, llcrnrlat=ozMinLat, urcrnrlon=ozMaxLon, urcrnrlat= ozMaxLat, rsphere=(rEquat,rPolar), resolution='c', area_thresh=1000.,projection='lcc', lat_1=trueLat1, lat_2=trueLat2, lat_0=centerLat, lon_0=centerLon) m.drawcoastlines() plt.show()