How can I manage to make a imshow() figure whitout any padding or axes?
I seem to have an usual problem that has been answered here before, but none of the solutions work for me. I have a figure generated by PyPlot under Julia, which is apparently a frontend for matplotlib.pyplot, and "should" behave accordingly. The problem is that I can manage in Jupyter to have a figure without white padding or bounding box. But when I save, it insists on putting the bounding box around.
I have tried the solutions in this thread and also in this other thread. None worked. Here is my code:
blabla=randn(40,500)
tuabuela=PyPlot.figure(frameon=false)
gca().set_axis_off()
subplots_adjust(top = 1, bottom = 0, right = 1, left = 0,
hspace = 0, wspace = 0)
tu=imshow(blabla, interpolation="gaussian")
margins(0,0)
savefig("outname.png", bbox_inches="tight", pad_inches=0.01, frameon=false, dpi=90)
The code gives a good image on the Jupyter Notebook, but not at saving. frameon=false
seems to only change the frame from white to transparent, not to eliminate it.
My matplotlib is 2.2.2, Python 3.6, and Julia 1.0.3.
The image as it appears on the Notebook (which, i discovered, is the same as the one saved, but the transparent frame was deceptive):
I am perfectly aware that this is a "repeated question", but the hodgepodge of different answers and their non-working status seems to me that the matplotlib library has almost done this more in the direction of changing a feature to a bug....