フィルターのクリア

How to get the values on a given axis of a given figure ?

8 ビュー (過去 30 日間)
Léonard Roussel
Léonard Roussel 2012 年 10 月 16 日
Hello,
I'm doing a little re-labeling function on an existing figure and I need to get the number of values on the X axis. The data plotted on the figure is supposed to be unknown, and I was wondering if it was possible to more generally retrieve the data values from the axes of any given figure.
Thank you very much for you help
all the best
L.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 16 日
編集済み: Azzi Abdelmalek 2012 年 10 月 16 日
x=0:0.1:10;
y=sin(x)
plot(x,y)
%select a plot in your figure, then run this:
xdata=get(gco,'Xdata') % to get X-axis data
Ydata=get(gco,'Ydata') % to get Y-axis data

その他の回答 (1 件)

Léonard Roussel
Léonard Roussel 2012 年 10 月 17 日
Thank you very much for your help.

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by