How to save a figure that is larger then the screen?
84 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Daniel Shub
2012-5-3
You cannot make figures larger than the screen size and if an axis does not fit in a figure, it gets truncated.
One possibility is to reduce the ScreenPixelsPerInch root property
set(0, 'ScreenPixelsPerInch', x)
where x is chosen so that MATLAB will think your monitor has both a width and height greater than or equal to 53 cm. You probably want to add some padding also for task and menu bars.
I have no idea how this will affect the output.
2 个评论
Tim Keiper
2020-4-22
This no longer works in Matlab 2019 - ScreenPixelsPerInch set to read only. is there a new solution using export_fig.m?
更多回答(2 个)
Demis John
2013-11-27
编辑:Demis John
2013-11-27
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 个评论
Daniel Shub
2013-11-27
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
2013-10-28
The answer is very elegant and uses the paper property size to print a figure of any size you want. Very helpful.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!