MATLAB Answers

Invert or reverse Yaxis ticks in a plot or scatter graph

조회 수: 36(최근 30일)
Stephen Devlin
Stephen Devlin 22 Aug 2017
댓글: José-Luis 22 Aug 2017
Hi,
I can find documentation to reverse the Yaxis for imagesc but not for a regular plot. I have data where the origin is the top left hand corner and want to preserve that y measurement rather than have it flipped.
sample code:
x=1:10
y=[0.4 0.61 0.45 0.66 0.41 0.63 0.44 0.62 0.46 0.6]
scatter(x,y,'filled','bo')
What I would like to see is a plot with the axis left the way it is but the Y-axis start with say 0.4 at the top and increase as it gets closer to the Xaxis intercept.
Any ideas?

  댓글 수: 0

로그인 to comment.

채택된 답변

José-Luis
José-Luis 22 Aug 2017
x=1:10;
y=[0.4 0.61 0.45 0.66 0.41 0.63 0.44 0.62 0.46 0.6];
aH = axes;
scatter(aH,x,y,'filled','bo');
aH.YDir = 'reverse';

  댓글 수: 2

Stephen Devlin
Stephen Devlin 22 Aug 2017
Perfect, thank you José.

로그인 to comment.

추가 답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by