Plot Three Variables with Three separate Y axis
4 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Bjorn Gustavsson
2021 年 8 月 3 日
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!