BacktoPython Index
import
from matplotlib import pyplot as plt
plt.switch_backend('agg')
plot and save
frame = plt.gca()
plt.imshow(data)
#plt.colorbar()
frame.axes.get_yaxis().set_visible(False)
frame.axes.get_xaxis().set_visible(False)
frame.spines['top'].set_visible(False)
frame.spines['bottom'].set_visible(False)
frame.spines['left'].set_visible(False)
frame.spines['right'].set_visible(False)
plt.savefig('filename'+'.extension',\
bbox_inches='tight',pad_inches=0,dpi=150)
plt.close()