I am using matplotlib along with the basemap with the following code
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap,cm
#Map Center
core = (151.35,-23.92)
LAT = core[1]
LON = core[0]
zoom_scale = 5/111
#create a bounding box from the central co=ordinates
bbox = [LAT-zoom_scale,LAT+zoom_scale, LON-zoom_scale,LON+zoom_scale]
#create an instance of the basemap object
m = Basemap(epsg=4326,llcrnrlat=bbox[0],urcrnrlat=bbox[1],\
llcrnrlon=bbox[2],urcrnrlon=bbox[3],resolution='i')
#Add and arcgis basemap
m.arcgisimage(service="World_Imagery", xpixels=7000, verbose=False)
t = Bbox.from_extents(151.324,-23.9414,151.357,-23.9117)
#save the image
plt.savefig(plotOutDir+'/'+ "new", bbox_inches = t,pad_inches = 0)
This is the output Sample image
However this is saving the whole map as an image. Is there is a way to save just a small extent of this map as a png by passing in an extent object as one of the arguments in the plt.savefig method? or is there any other way to achieve this?