How to plat three similar figures together for comparison?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to plot three sets of data together where both A sets go together, both B sets go together and both C sets go together. The way I am doing it I only get the A sets to appear on the figure. What am I doing wrong or need to change so that these data sets all appear on the same figure to compare versus one another?
plot(medianVsA(:,1),medianDepthA(:,1),medianVsB(:,1),medianDepthB(:,1),medianVsC(:,1),medianDepthC(:,1),'b','linewidth',2.5);
hold on
Thank you for the help in advance.
0 comentarios
Respuestas (2)
Star Strider
el 29 de Mzo. de 2018
Without your data it is not possible to determine what the problem may be.
However, you are telling plot to use a blue line for all of the data. Use the default color line progression and they will plot in different colours.
Example —
A = [(1:10)' rand(10,1)];
B = [(1:10)' rand(10,1)];
figure
plot(A(:,1), A(:,2), B(:,1),B(:,2), 'b')
title('Blue Lines For All Data')
figure
plot(A(:,1), A(:,2), B(:,1),B(:,2))
title('Default Line Color Progression')
0 comentarios
jfrazie9
el 29 de Mzo. de 2018
2 comentarios
Star Strider
el 29 de Mzo. de 2018
The range of your data are extreme. For example, 'medianDepthA' goes from 0.855 to 69, and then jumps at the end to 1E+99. (Also, ‘medianVsA’ in the files you posted is one element longer than 'medianDepthA'.)
When in doubt, plot with markers, since it makes your data easier to see:
figure
plot(medianVsA(1:end-1), medianDepthA, '-p')
Including the extra dimension is redundant, although the plot is correct:
plot(medianVsA(1:end-1,1), medianDepthA(:,1), '-p')
That is the only problem I see.
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!