Clear Filters
Clear Filters

Copy all features of a figure inside a subplot for print multiple images in a single page pdf

7 views (last 30 days)
Hi everybody... There is a way to copy one figure with ALL its features inside a subplot? Let me explain my problem: i'm plotting a series of graphs which i have to print in a pdf file in scale 1:1... At now, i obtained that with this code:
fig = figure(1);
plot(.....)
hold on
grid on
plot(.....)
axis equal
axis off
set(gca, 'Position',[0 0 1 1])
axis([...]) %Axis Limit
fig_height=Value;
fig_width=Value;
set(gcf,'Units','centimeters','position',[0 0 fig_width fig_height])
set(gcf, 'PaperPositionMode','auto')
print(fig,'FileName','-dpdf','-r300')
This code works properly for printing a single figure on pdf, but i'm searching a way to put multiple figure in a single page pdf and i thought about using subplots. I've tried to use copyobj but some property of the figure doesn't been copied. I've tried also to manualy copy the each plot code after the subplot command but i'll not obtain a subplot but a normal single figure... I hope someone can help me!!!
PS: if someone would suggest me another way to print multiple figure on a single page pdf will be appreciated too!!!

Answers (1)

Walter Roberson
Walter Roberson on 7 Oct 2016
No, it is not possible in the general case. In the general case, figures include menu bars, uipanels, uitabgroups, and uicontrols, none of which can be placed inside of axes objects (subplots are axes objects.) Also, for R2014a and earlier, colorbar() and legend() are implemented as axes, and axes cannot be placed inside axes. IN R2014b and later, colorbar and legend are not implemented as axes, but they cannot be parented to an axes either (needs to be a container object such as a figure or uipanel.)
Have you investigated the possibility of using the File Exchange contribution export_fig() which includes a routine to append multiple files into a pdf?
  2 Comments
Packy
Packy on 7 Oct 2016
Yes i've already seen that function, but i have to write this code inside a GUI for sharing it with some friends; the problem of export_fig is that it requires a ghostscript, and i prefer to not oblige anyone to install anything (except MCR). Do you know if exist another way to save a multi page pdf?

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!