How do I plot multiple Y axis data?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Nanje Gowda Appanna
il 19 Gen 2024
Commentato: Nanje Gowda Appanna
il 19 Gen 2024
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..
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1594536/image.jpeg)
when I use the above codes I am getting a plot like below..
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1594541/image.jpeg)
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1594546/image.png)
Can you help me to plot predicted values trend line over the observed data as shown in the figure1.
0 Commenti
Risposta accettata
Walter Roberson
il 19 Gen 2024
[TempS, idx] = sort(Temp);
PrdS = Prd(idx);
plot(TempS, PrdS, 'o-', 'color', 'red', 'LineWidth', 2)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Axis Labels in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!