I want to build a visualizer for 2D filter-Arrays which are generated from code in python. They will be of size 2x2 to 7x7.
pyplot.imshow(oneFilter)
gives me neat results, which I want to store for each of the 3000 arrays that I have. People suggest pyplot.imsave('onefilter.jpg', oneFilter)
, however the results differ significantly from what imshow
generates.
Imshow let's you save its result, which generated the following figure for a 5x5 array: pic,that clicking on save creates
I want THAT pic (even better without axis but beggars can't be choosers, I guess) saved automatically.
imsave()
however, will save an actual 5x5 pixel wide image, which at this scale is completely useless, since you can't put it in a paper, or even look at it to infer anything. Furthermore the colormap seems to differ between the two functions. difference imsave(left) and imshow(right)
So: How do I get the plot that imshow()
creates saved to my computer, without showing it on screen? Since the shown plot includes a save button, there has to be a method somewhere.
I have tried to save the result of imshow()
in a variable but it returns an 'AxesImage' which seems to have no save method.
Alternatively, how would one proceed to generate these kind of plots differently in python. Input are my 2D-arrays, output should be something palatable to the eye. I'm eager to learn a better way.