Figure printing size and printing in latex
Show older comments
I have multiple of Matlab figures and I need all the figures to have the same size when I save them as Pdf but I can't make them equal, is there a way just to copy the sixe configuration from figure to another. Thanks in advance
4 Comments
Elias Gule
on 17 Jan 2018
A Matlab figure has a 'Position' property which returns a 1-by-4 array. The array elements are ordered like this:
x = array(1); % the x-coordinate of the bottom-left corner
y = array(2); % the y-coordinate of the bottom-left corner
w = array(3); % the width of the figure
h = array(4); % the height of the figure
where, array = get(gcf,'Position'); or get(hFig,'Position');
NB. hFig is the handle (loosely a variable in which the figure object is stored) to the figure.
For more info on figure properties, type "doc figure" (without quotes) on the command window.
Jan
on 17 Jan 2018
What does "I can't make them equal" mean? What did you try and what happens instead of which expectations? How do you save the PDF files?
Diana
on 17 Jan 2018
Jan
on 17 Jan 2018
The same size of what? Remember that the readers do not have the faintest idea about what you are doing.
Answers (1)
Jan
on 17 Jan 2018
If you create a PDF, not the 'Position' of the figure matters, but the 'PaperPosition' and 'PaperUnits'.
If you have the handles of all figures in one vector, you can set the properties in one command:
fig(1) = figure;
fig(2) = figure;
...
set(fig, 'PaperUnits', 'cm', 'PaperSize', [10, 15]);
3 Comments
Diana
on 17 Jan 2018
Diana
on 17 Jan 2018
Elias Gule
on 17 Jan 2018
@Diana, please change
hi = get(gcf);
to
hi = gcf;
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!