How do I reverse the y axis label on a graph?

11 ビュー (過去 30 日間)
Sara
Sara 2017 年 9 月 21 日
コメント済み: Walter Roberson 2017 年 9 月 21 日
I have multiple things plotting on one graph and have one of the axes on the right side and the other two on the left. I would like to reverse the order of the right side label only. I do not want to reverse the axis. Is there a way to do this? Thanks!

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 9 月 21 日
ax = gca;
xt = get(ax, 'xtick');
xtl = get(ax, 'xticklabel');
mask = xt > 0;
xtl(mask) = fliplr( xtl(mask) );
set(ax, 'xticklabel', xtl)
  4 件のコメント
Sara
Sara 2017 年 9 月 21 日
That just flipped each individual letter. I'll just deal with it. Thanks.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by