Can you automatically save a figure in A3 as a pdf?

6 次查看(过去 30 天)
Hi guys,
I have created a figure with the following dimensions.
fig = figure('Name','Example','Position',[-300 1120 2200 1300]);
I need the dimensions to be able to display them so well on my screen and I can't change them. However, I would now like to save the figure as a PDF in A3 format and possibly print it. Unfortunately, I have not yet found a way of automatically adapting the figure to the size of an A3 sheet in landscape format. Can anyone help me?
Many thanks in advance!

回答(1 个)

Divyanshu
Divyanshu 2023-4-17
To save the figure as a pdf on a A3 size paper in landscape you can have a look at the below demo script which saves a simple plot figure as a pdf in landscape mode.
figure('Name','Example','Position',[-300 1120 2200 1300]);
plot([1 2 3],[2 4 6])
set(gcf,'Units','inches');
screenposition = get(gcf,'Position');
set(gcf,...
'PaperPosition',[0 0 screenposition(3:4)],...
'PaperOrientation','landscape',...
'PaperType','a3',...
'PaperSize',[screenposition(3:4)]);
print -dpdf -vector newFig
The figure would be saved with a name newFig.pdf. And please refer to the following documentation for detailed understanding of various properties and options of set function:

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by