How to plot a graph with 2 Y axis of different scale in Matlab 2015?

조회 수: 40 (최근 30일)
I need to plot 2 plots on the same graph with one y axis on the left and other y axis on the right in Matlab 2015.

채택된 답변

Mustafa Abu-Mallouh
Mustafa Abu-Mallouh 2019년 1월 15일
편집: Mustafa Abu-Mallouh 2019년 1월 15일
For MATLAB R2015_, take a look at the plotyy function. That should be what you are looking for.
Beginning with R2016a, you would want to take a look at the yyaxis function and use that instead.
  댓글 수: 2
Yadu Bhusal
Yadu Bhusal 2022년 3월 2일
편집: Yadu Bhusal 2022년 3월 2일
Well I was stuck on the same problem. I want 3 data set in primary y axis and 2 data set on secondary y axis with common data along x axis. I tried with [hAx, hLine1, hLine2] = plotyy([x',x',x'],[y1,y2,y3],[x',x'],[y4,y5]) It didn't work. But it worked for two data on primary and one data in secondary. Any help would be appreciated.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)


Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기


Community Treasure Hunt

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

Start Hunting!

Translated by