필터 지우기
필터 지우기

How to get the value of 'x' from a figure?

조회 수: 1 (최근 30일)
eduardoq
eduardoq 2013년 2월 12일
Hello,
I'm trying to get the value of the x axis from a figure. I am currently using gtext, is there another way?
Cheers

답변 (3개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 12일
Click on your plot then type in command windows
x=get(gco,'xdata')

Thorsten
Thorsten 2013년 2월 12일
편집: Thorsten 2013년 2월 12일
Depending on what you need, try
xlim
or
get(gca, 'XTick')

eduardoq
eduardoq 2013년 2월 12일
Found it!
ggg=gtext('hhh');
click on the figure the coordinate you wish to know
get(ggg);
look into 'Position' and done
or simply click on tools in the figure window, data cursor and click the point you are trying to find the corrdinates

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by