How to plat three similar figures together for comparison?
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (2개)
Star Strider
2018년 3월 29일
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
jfrazie9
2018년 3월 29일
댓글 수: 2
Star Strider
2018년 3월 29일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!