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

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일

0 개 추천

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일
I don't want the tick marks to be going in the opposite order, I want the actual label to be going in the opposite direction:
ylabel('Y-axis')
ylabel( flipr('Y-axis') )
?
Sara
Sara 2017년 9월 21일
That just flipped each individual letter. I'll just deal with it. Thanks.

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

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

질문:

2017년 9월 21일

댓글:

2017년 9월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by