mcfly
mcfly

Reputation: 1151

python and Basemap and remove Mexico/Canada from view

I am using Basemap within Matplotlib to draw a map of the United States. However, I cannot seem to be able to remove Mexico or Canada to just have the US shown. I need to draw the states as well. Currently, my code is:

self.map = Basemap(llcrnrlon=-119, llcrnrlat=22, urcrnrlon=-64,
                               urcrnrlat=49, projection='lcc', lat_1=33, lat_2=45,
                               lon_0=-95, resolution='i', area_thresh=10000,ax=self.axes)

self.map.drawcoastlines()
self.map.drawcountries()
self.map.drawstates()
self.figure.canvas.draw()

This draws the US with some Mexico and Canada shown. If i comment out self.map.drawcountries(), then the southern and northern US borders are removed, so this doesn't help. If i comment out self.map.drawcoastlines(), this removes the East and West borders. I cannot find any other command that allows me to have just the US (with states) drawn.

Any ideas? Thanks!

Upvotes: 4

Views: 4450

Answers (0)

Related Questions