-
-
Save RomaKoks/28b8719d8ec83f4b3b768b5e89ebefb4 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment