How to save a figure that is larger then the screen?
Show older comments
Hello,
i'm trying to save a 53x53 cm sized figure to an .eps-file. This results in a file containing only the on screen visible part of the figure. I'm using the Save As Option of the figure's menubar.
Example-Code:
plot(1:50,1:50);
set(gca, 'units', 'centimeters');
set(gca, 'position', [3 3 53 53]);
Thx, Peter
Accepted Answer
More Answers (3)
Demis John
on 27 Nov 2013
Edited: Demis John
on 27 Nov 2013
I Agree - see Jim's link above (skip the 2 spam posts & see Romesh's explanation) - enables one to save a figure of arbitrarily large size, regardless of size on screen.
You essentially use
set(gcf, 'PaperPosition', [0 0 20 20]) % can be bigger than screen
set(gcf, 'PaperSize', [20 20]) % Same, but for PDF output
& the print command:
print(gcf, 'MyFigure.png', '-dpng', '-r300' ); %save file as PNG w/ 300dpi
print(gcf, 'MyFigure.pdf', '-dpdf', '-r300' ); %save file as PDF w/ 300dpi
Units are inches by default; can change 'Units' property if desired.
1 Comment
Daniel Shub
on 27 Nov 2013
I don't see how this works. If I want an axis that is exactly 53 cm x 53 cm what commands do I need to run?
Jim
on 28 Oct 2013
0 votes
The answer is very elegant and uses the paper property size to print a figure of any size you want. Very helpful.
Adam Danz
on 8 Dec 2025
0 votes
Starting in R2025a, exportgraphics has options to specify the size of the exported figure. These features are exported in detail in the Graphics and App Building blog: https://blogs.mathworks.com/graphics-and-apps/2025/12/08/advanced-control-of-size-and-layout-of-exported-graphics/
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!