Something that has bothered me for *the entire* time I’ve used it is that when you show images using ‘imshow’ the resulting figure has the image surrounded in a sea of gray border. Well, I hate that gray border. It serves no purpose and today I have figured out how to remove it!
Matlab runs a script called ‘startup.m’ when it starts. This is located in your ~/matlab/ directory. If you include this line into that file (or just type it before you make the figure) then you remove the gray border:
Its glorious… Now the picture scales to fill the whole window! (note this only works with the ‘imshow’ command, not ‘imagesc’).
BUT! That’s not all. I also learned about some other cute little tricks that should be included in your startup.m (if you’re me at least).
%removes menu and toolbar from all new figures
%makes disp() calls show things without empty lines
I feel like these three commands cut a lot of the pointless (inefficient) crap out of Matlab’s default display interface. Thanks to commenter Matt who pointed me toward the set(0,’Default… thing. You can use this to set up *tons* of settings so that you don’t have to set it every time. Just call:
For some other useful tips on exporting figures for papers, check this related post.