Create one figure from 2 different figures

3 views (last 30 days)
Tolga MERT
Tolga MERT on 25 Jul 2014
Commented: Image Analyst on 25 Jul 2014
Hello everyone,
I have 2 different figures. One of them is an empty template with logos, a kind of a background. The other one is the existing subplots. The question is, how can I make matlab generate the subplots on this empty template figure with logos ?
tempfigure1 = figure('PaperType','A4','PaperSize',[29.7 21],'PaperOrientation', 'landscape',...
'Color',[1 1 1],'Units', 'centimeters','Position',[2 2 29.7 21]);
% The code continues like this with tempfigure1
A part of the other figure is created with this code:
subplot(tempPosition{tempCNT,1},tempPosition{tempCNT,2},tempPosition{tempCNT,3});
%alltemps are already defined before this line
With those codes, matlab gives me 2 different figures that I don't need. After creating them both in a figure I would like to export it as pdf with this following code which just exports one of the figures :
print(gcf, '-dpdf', 'output.pdf');
I appreciate your help !
Regards,
Tolga

Answers (1)

Ben11
Ben11 on 25 Jul 2014
I think you need to use
hold on
before the first plot and
hold off
after the last plot so that you get a single figure. Sounds simple but it should do the trick.
  1 Comment
Image Analyst
Image Analyst on 25 Jul 2014
Tolga's "Answer" moved here since it looks like it should be a comment to Ben11:
"hold on" works perfectly!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by