How to get the values on a given axis of a given figure ?
조회 수: 4 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
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
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!