Borrar filtros
Borrar filtros

How to merge different customized figures together?

2 visualizaciones (últimos 30 días)
MJ
MJ el 3 de Feb. de 2014
Comentada: MJ el 4 de Feb. de 2014
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 comentarios
Walter Roberson
Walter Roberson el 3 de Feb. de 2014
Can the code that generates the figures be changed, or does the process need to work starting with fully drawn figures ?
MJ
MJ el 4 de Feb. de 2014
Sure! Please execute my codes and see what I'm looking for. Anything that gives me something like that would work!

Iniciar sesión para comentar.

Respuesta aceptada

Amit
Amit el 4 de Feb. de 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.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by