In numpy/scipy I have an image stored in an array. I can display it, I want to save it using savefig without any borders, axes, labels, titles,… Just pure image, nothing else.
I want to avoid packages like PyPNG or scipy.misc.imsave, they are sometimes problematic (they do not always install well, only basic savefig() for me
EDIT
Changed
aspect='normaltoaspect='auto'since that changed in more recent versions of matplotlib (thanks to @Luke19).Assuming :
To make a figure without the frame :
To make the content fill the whole figure
Then draw your image on it :
The
aspectparameter changes the pixel size to make sure they fill the figure size specified infig.set_size_inches(…). To get a feel of how to play with this sort of things, read through matplotlib’s documentation, particularly on the subject of Axes, Axis and Artist.