フィルターのクリア

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

16 ビュー (過去 30 日間)
Max1234
Max1234 2023 年 4 月 13 日
回答済み: Divyanshu 2023 年 4 月 17 日
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 Center および File ExchangeSubplots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by