필터 지우기
필터 지우기

How to merge different customized figures together?

조회 수: 2 (최근 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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by