필터 지우기
필터 지우기

How to have two seperate y labels for the same line?

조회 수: 2 (최근 30일)
Colby
Colby 2015년 8월 10일
편집: Azzi Abdelmalek 2015년 8월 10일
I would like to have a plot which has a lines true value for the y axis on the left side, and that value as a percentage of a given value on the right. For an example
t = 1:50;
y = logspace(1,5);
y2 = (y/1000000)*100;
plot(t,y)
figure
plot(t,y2)
Plot one is a logarithmic line with its true value. Then the second plot is the same line, but its value as a percentage of 1000000. How could I get this as one plot? Thanks so much for your time and for sharing your expertise!

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 8월 10일
편집: Azzi Abdelmalek 2015년 8월 10일
t = 1:50;
y = logspace(1,5);
y2 = (y/1000000)*100;
plot(t,y)
hold on
plot(t,y2)
Or
plotyy(t,y,t,y2)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by