필터 지우기
필터 지우기

Label the actual data points in y-axis

조회 수: 2 (최근 30일)
hmhuang
hmhuang 2021년 9월 9일
댓글: Star Strider 2021년 9월 9일
I have a plot with two plotting by using yyaxis. The grid on the right yyaxis is currently aligned with the left yyaxis according to this thread. Now I want to also label the actual data points on the right yyaxis. How can I achieve this as illustrated in the following image?

채택된 답변

Star Strider
Star Strider 2021년 9월 9일
One approach —
x = linspace(0, 10, 5);
yl = 250*(1-exp(-0.5*x));
[xr,yr] = stairs(x,yl/17);
figure
yyaxis left
plot(x, yl)
yyaxis right
plot(xr, yr)
set(gca, 'YTick',[2 7 11]);
grid
Experiment to get different results.
.
  댓글 수: 4
hmhuang
hmhuang 2021년 9월 9일
Thank you!
Star Strider
Star Strider 2021년 9월 9일
As always, my pleasure!
.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by