Created
February 25, 2013 05:30
-
-
Save corydolphin/5027957 to your computer and use it in GitHub Desktop.
Saving figures in MATLAB as full size, not cutoff. Gets around issue of cutting off Title, etc. Slightly slow, but it works. Damnit MATLAB graphics library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [ output_args ] = saveFigure( handle, fileName ) | |
% saveFigure | |
% Saves figure specified by `handle` as `fileName` in fullscreen | |
% as to get around the stupid behavior. | |
screen_size = get(0, 'ScreenSize'); | |
origSize = get(handle, 'Position'); % grab original on screen size | |
set(handle, 'Position', [0 0 screen_size(3) screen_size(4) ] ); %set to scren size | |
set(handle,'PaperPositionMode','auto') %set paper pos for printing | |
saveas(handle, fileName) % save figure | |
set(handle,'Position', origSize) %set back to original dimensions | |
end |
Thanks. It saves a lot of trouble.
Nice, thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Finally something that works! Thanks a lot, @corydolphin!