How to get two lines and double y axis on plot?

조회 수: 1 (최근 30일)
Anonymous
Anonymous 2018년 10월 28일
답변: madhan ravi 2018년 10월 28일
I know this is simple and I have done it before, but for some reason this is not working and I have been trying this for way too long and am so frustrated. I have plotted both on a figure and know the two lines are not exactly the same. I am trying to plot 2 data sets (the same length) against time, and have two y axis. Here is what I have that is not working.
figure(1)
yyaxis right
plot(tR1,PR1)
ylabel('Pressure (Pa)')
hold on
yyaxis left
ylabel('Heart Flow Rate (mL/s)')
plot(tR1,FR1)
xlabel('Time (s)'),
legend('Blood Pressure','Flow Rate')

채택된 답변

madhan ravi
madhan ravi 2018년 10월 28일
figure(1)
yyaxis left
plot(tR1,PR1)
ylabel('Pressure (Pa)')
hold on
yyaxis right
plot(tR1,FR1)
xlabel('Time (s)')
ylabel('Heart Flow Rate (mL/s)')
legend('Blood Pressure','Flow Rate')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by