채택된 답변

Walter Roberson
Walter Roberson 2016년 4월 6일

0 개 추천

plot(rand(1,30))
set(gca,'YDir', 'reverse')

댓글 수: 3

Thank you for your guidance sir
have you check output of this code? @LAKSHMANAN ADAIKKAPPAN
Walter Roberson
Walter Roberson 2016년 4월 7일
편집: Walter Roberson 2016년 4월 7일
Certainly I have checked the output of the code. If you prefer to see the full 0 to 14 and 0 to 16, change the graph to use that, such as
plot(0:16, 14 * rand(1,17))
and you might want to set the axis location as well,
set(gca, 'ydir', 'reverse', 'xaxislocation', 'top')
This could be taken further to get rid of the tick marks but leave the tick labels. The ease of doing that would depend upon the MATLAB version being used.

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

추가 답변 (2개)

Muhammad Usman Saleem
Muhammad Usman Saleem 2016년 4월 6일
편집: Muhammad Usman Saleem 2016년 4월 6일

0 개 추천

UPDATE 1:
may try this
plot(1:10)
box off
axes('xlim', [1 10], 'ylim', [1 10], 'color', 'none', 'YAxisLocation', 'right', 'XAxisLocation', 'top')
for reading read here
or may try this
t=0:0.1:10;
y=sin(t);
plot(t,y)
set(gca,'XAxisLocation','top','YAxisLocation','left','ydir','reverse');

댓글 수: 3

Thank you for your guidance. It will give following figure. But, this is not i need it. Actually i want origin at left top corner?
No, the key is YDir reverse
LAKSHMANAN ADAIKKAPPAN
LAKSHMANAN ADAIKKAPPAN 2016년 4월 6일
편집: LAKSHMANAN ADAIKKAPPAN 2016년 4월 6일
Thank you for your guidance sir. It will work.

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

Steven Lord
Steven Lord 2016년 4월 6일

0 개 추천

plot(1:10, 1:10);
axis ij
Or if you have the handle of your axes object already, change its YDir property to 'reverse' as Walter showed.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by