I use the Basemap in Matplotlib to draw a map of the United States. However, I seem to be unable to remove Mexico or Canada to show the USA. I need to also draw states. My current 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()
It attracts the USA with some Mexico and Canada. If I comment on self.map.drawcountries() , the southern and northern borders of the United States will be removed, so this will not help. If I comment on self.map.drawcoastlines() , this will remove the borders of East and West. I canβt find any other team that allows me to have only the USA (with states).
Any ideas? Thanks!
mcfly source share