Plot Three Variables with Three separate Y axis

5 visualizaciones (últimos 30 días)
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');

Respuesta aceptada

Bjorn Gustavsson
Bjorn Gustavsson el 3 de Ag. de 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

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by