Reverse y axis order
조회 수: 121 (최근 30일)
이전 댓글 표시
Hi. I have the following script (attached )b and the run that it opens can be found at this link.
https://drive.google.com/open?id=0B0wQbicZOF7xN1BXV1FKVVRCT2c
It works perfectly except I want to reverse the the y- axis. I have tried several things but no luck. The only way I found is to do it manually. Is there another way?
댓글 수: 0
채택된 답변
Adam
2017년 3월 28일
set( hAxes, 'YDir', 'reverse' )
should do this for an axes hAxes.
댓글 수: 3
Adam
2017년 3월 28일
So is it working or not now? You accepted an answer so I assume so, but your comment suggests otherwise.
As I mentioned, hAxes is an axes handle, how you get this is up to you. I would never use 'gca' except in a temporary script though, you should keep a handle to your axes and use this explicitly.
추가 답변 (1개)
KSSV
2017년 3월 28일
N = 10 ;
x = rand(N,1) ;
y = 1:N ;
figure(1)
plot(x,y) ;
figure(2)
plot(x,y) ;
set(gca,'Ydir','reverse')
댓글 수: 5
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!