Plot Three Variables with Three separate Y axis
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Patrick Lonergan
le 3 Août 2021
Réponse apportée : Bjorn Gustavsson
le 3 Août 2021
Hi I am trying to plot three vairables on one graph. I am currently plotting it two seperate graphs and comparing but it would be really useful if I could plot one graph with all three vairables. The code I am using to produce the two graphs is as below:
yyaxis left
y=plot(failure.RMS)
ylabel("RMS Error")
yyaxis right
y=plot(failure.RollingAverage)
ylabel("rate of change of Power(W/10min)(rolling 500)")
legend("RMS Error of ML prediction","Rate of change of Power")
legend("Location","northwest")
title("RMS Error and Rolling average rate Of Power Prior to failure")
saveas(y,"Rolling_RMS Error1_11",'jpg');
saveas(y,"Rolling_RMS Error1_11",'m');
clf
yyaxis left
y=plot(failure.RMS)
ylabel("RMS Error")
yyaxis right
y=plot(failure.RollingAvePower)
ylabel("rate of change of Power(KW)(rolling 500)")
legend("RMS Error of ML prediction","Rolling Power Average")
legend("Location","northwest")
title("RMS Error and Rolling average Power Prior to failure")
saveas(y,"Rolling_power Error1_11",'jpg');
saveas(y,"Rolling_power Error1_11",'m');
0 commentaires
Réponse acceptée
Bjorn Gustavsson
le 3 Août 2021
You might use the plotyyy function from the matlab file excange to do just that. Or any of the other functions that show up when searching for plotyyy: FEX: plotyyy.
HTH
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!