Make MATLAB Plots fill the whole window

I’m currently working on a documentation for a lab-course on university and i faced the problem, that MATLAB-exported-plots actually not fill the complete space of the picture.

I tried some settings in the export window, one of them was “expand axes to fill figure”. Sounds like doing stuff properly? Yes, but it didn’t, in fact it did nothing. At least i haven’t noticed anything… BUT helps on the way! Some guys on the internet always have that solution, that not even the staff over at mathworks knows. Basically it’s just setting some “figure-property” to not make so much whitespace:

set(gca, ‘LooseInset’, get(gca, ‘TightInset’));

And voila, your plot should fill the whole window without creating much whitespace, which is perfectly fine for exporting plots for documentations.
You can also check out some more propertys at http://undocumentedmatlab.com/blog/axes-looseinset-property

I hope this helps somebody, let me know other tricks in the comments!

Georg

Leave a Reply

Your email address will not be published. Required fields are marked *