フィルターのクリア

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 Center および File ExchangeLabels and Annotations についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by