How to merge different customized figures together?
1 view (last 30 days)
Show older comments
I am going to draw several figures and merge them together. Below is the codes that I have for one of the figures; the others are pretty similar but they have different values.
Let's say I have five of these figures. Do you know how to merge them together (they should come up on top of each other with a little distance) so that I can get only one figure? I have tried to customize the subplot but it wasn't as flexible as I needed.
Thanks!
hFig = figure();
set(hFig, 'Position', [100 250 300 80]);
hAxes = axes('NextPlot','add','XTick',[-1:1:3],'XTickMode','manual','DataAspectRatio',[1 1 1],'XLim',[0 3],'YLim',[0 .41],'TickDir','out','Color','none');
hold(hAxes,'all');
set(gca,'ycolor','w');
plot(2.0557,.05,'mo','MarkerSize',5,'MarkerFaceColor','m');
plot([1.1406 2.9708],[.06 .06],'k');
plot(0.5929,.1,'d','MarkerSize',5,'MarkerFaceColor','c');
plot([0.0401 1.1458],[.12 .12],'k');
plot(0.6813,.35,'ks','MarkerSize',6,'MarkerFaceColor','b');
plot([ 0.1976 1.1651],[.35 .35],'b');
2 Comments
Walter Roberson
on 3 Feb 2014
Can the code that generates the figures be changed, or does the process need to work starting with fully drawn figures ?
Accepted Answer
Amit
on 4 Feb 2014
set(hFig, 'Position', [100 250 300 5*80]);
for jj = 1:5
h1 = subplot(5,1,jj);
% hAxes =
set(h1,'XTick',[-1:1:3],'XTickMode','manual','DataAspectRatio',[1 1 1],'XLim',[0 3],'YLim',[0 .41],'TickDir','out','Color','none','ycolor','w');
hold on;
%set(gca,'ycolor','w');
plot(2.0557,.05,'mo','MarkerSize',5,'MarkerFaceColor','m');
plot([1.1406 2.9708],[.06 .06],'k');
plot(0.5929,.1,'d','MarkerSize',5,'MarkerFaceColor','c');
plot([0.0401 1.1458],[.12 .12],'k');
plot(0.6813,.35,'ks','MarkerSize',6,'MarkerFaceColor','b');
plot([ 0.1976 1.1651],[.35 .35],'b');
end
each subplot has similar properties as any other axis. Try the code above and see if this type of plot is what you're looking for. I didn't have other data, so I plotted the same thing 5 times.
More Answers (0)
See Also
Categories
Find more on 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!