フィルターのクリア

Label the actual data points in y-axis

1 回表示 (過去 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 Center および File ExchangeGrid 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