Effacer les filtres
Effacer les filtres

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

16 vues (au cours des 30 derniers jours)
Max1234
Max1234 le 13 Avr 2023
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!

Réponses (1)

Divyanshu
Divyanshu le 17 Avr 2023
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:

Community Treasure Hunt

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

Start Hunting!

Translated by