How do I plot multiple Y axis data?

조회 수: 1 (최근 30일)
Nanje Gowda Appanna
Nanje Gowda Appanna 2024년 1월 19일
댓글: Nanje Gowda Appanna 2024년 1월 19일
Hi
I am trying to plot multiple data using below codes..
figure(3);
Temp= Data(:,1);
Obr= MU_OBS;
Prd = MU_PRED;
plot(Temp,Obr,'o','LineWidth', 2, 'MarkerSize', 8);
hold on;
plot(Temp,Prd,'o','color','red','LineWidth', 6);
I want to make a plot like below..
when I use the above codes I am getting a plot like below..
Actually, Prd data is a vector containing 1:400 predicted values by my model. I want to plot these predicted data as a single line over the observed data.
If I make the plot with 'o-' I am getting multiple lines like below figure..
plot(Temp,Prd,'o-','color','red','LineWidth', 2)
Can you help me to plot predicted values trend line over the observed data as shown in the figure1.

채택된 답변

Walter Roberson
Walter Roberson 2024년 1월 19일
[TempS, idx] = sort(Temp);
PrdS = Prd(idx);
plot(TempS, PrdS, 'o-', 'color', 'red', 'LineWidth', 2)
  댓글 수: 1
Nanje Gowda Appanna
Nanje Gowda Appanna 2024년 1월 19일
Hi
Thanks a lot for replying. It worked as I expected..

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by