How to merge different customized figures together?

1 回表示 (過去 30 日間)
MJ
MJ 2014 年 2 月 3 日
コメント済み: MJ 2014 年 2 月 4 日
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 件のコメント
Walter Roberson
Walter Roberson 2014 年 2 月 3 日
Can the code that generates the figures be changed, or does the process need to work starting with fully drawn figures ?
MJ
MJ 2014 年 2 月 4 日
Sure! Please execute my codes and see what I'm looking for. Anything that gives me something like that would work!

サインインしてコメントする。

採用された回答

Amit
Amit 2014 年 2 月 4 日
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.
  1 件のコメント
MJ
MJ 2014 年 2 月 4 日
Exactly what I need! Thanks very much! :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Objects についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by