How can I change axes labels?

from this:
0 ^
1 .
2 .
3 .
4 .
5 .
6 .
7 .
8 .
9 .
10.....................>
0 1 2 3 4 5 6 7 8 9 10
to this:
10^
9 .
8 .
7 .
6 .
5 .
4 .
3 .
2 .
1 .
0 .....................>
0 1 2 3 4 5 6 7 8 9 10
Thanks.

 채택된 답변

Matt Fig
Matt Fig 2012년 11월 28일

0 개 추천

set(gca,'ydir','normal')

댓글 수: 4

Tomislav
Tomislav 2012년 11월 28일
But this way my data is upside down. I want to keep the data the way it is.
Thanks
set(gca,'yticklab',flipud(get(gca,'yticklab')))
Matt Fig
Matt Fig 2012년 11월 28일
If that doesn't do what you need, then it sounds like your problem is with the data itself. You should scale and shift the data before plotting....
I did it. I messed things up with:
I=flipud(I);
I remove that and added Matt's answer and it was good.
Thank you for your time.

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

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 11월 28일
편집: Azzi Abdelmalek 2012년 11월 28일

0 개 추천

yt=get(gca,'ytick');
set(gca,'yticklabel',fliplr(yt))

댓글 수: 8

Tomislav
Tomislav 2012년 11월 28일
That keep tha data in place, but now when I pick a point with cursor data it shows the old data and it is not a mach with data on screen.
Thanks.
Azzi Abdelmalek
Azzi Abdelmalek 2012년 11월 28일
I think your comments are contradictory
Tomislav
Tomislav 2012년 11월 28일
No. Please, try to understand. I have data. It need to stay the way it is. The y label need to reverse, and when I pick a point with cursor data it need to match the changed y label. But it doesnt.
For example:
Old labels. Cursor data click bottom left corner it would show x=0, y=10.
On the new labels it will show the same but it need to show x=0, y=0.
Thanks.
Azzi Abdelmalek
Azzi Abdelmalek 2012년 11월 28일
편집: Azzi Abdelmalek 2012년 11월 28일
If you don't change your data, the data cursor will give the same values.
Tomislav
Tomislav 2012년 11월 28일
I understand. I thouht that there is some way that cursor follows the axis labels.
OK, thank you very much.
Azzi Abdelmalek
Azzi Abdelmalek 2012년 11월 28일
I did'nt say there is no way to make it looks like it following axis labels, but I don't understand what is your goal, perhaps there is better ways.
Tomislav
Tomislav 2012년 11월 29일
I explained my goal in upper comment. Ok, here is the whole situation. I have horizontal, saggital and coronal slice. I have put slices each in his axes and additionally all three in one 3D axes. Now I have to be able pick two points, either from 3D coordinates or from individual slice and they has to mach. But it doesnt. Y label on individual slice is upside-down in relation to the same slice in 3D coordinate system.
Thanks.
Tomislav
Tomislav 2012년 11월 29일
I figure it out. It was my fault. Messed up things with flipud function.
Thank you Azzi for your time and patience.

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

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

질문:

2012년 11월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by