Automatically remove white space from figure
1.010 views (last 30 days)
How do I remove the white space from the figures ? I don't want to have to save the image then manually crop it.
Instead of Matlab's dumb figure it would be something like
Is there such a function ?
Surender Raj on 3 Dec 2020
This problem can be addressed manually in Export setup. Once figures are done File--> Export setup --> Size --> Check expand axes to fill figures.
Image Analyst on 16 Jul 2017
Attach images showing what you have and what you want.
You can change the amount of gray padding about your axes by setting the Position property of the axes.
Julia on 11 Jun 2021
I find the following really useful:
First, assemble your figure as you normally would. Then, try this:
I0 = getframe;
I have the impression that it needs some time for saving, so if used in code where stuff happens after this line it can sometimes give weird results. If you have the figure ready and then execute the code from the command line, it normally works beautifully.