Having a scatter plot, when I click on one of the points, I get some information regarding that point e.g. X-value and Y-value and DataIndex (generated through a customized UpdateFcn). When
UT_points = getCursorInfo(dcm_obj);
a structure is built with fields as "Target" and "Position". How can I add a customized field to this structure e.g. "Data index"?

답변 (1개)

Santosh Gnanasekaran
Santosh Gnanasekaran 2019년 5월 23일

0 개 추천

plot(XValue,Y Value); %% Plots the data
a = get(gca,'Children');%% Gets the axes related data
xdata = get(a, 'XData'); %% extract the specific data and store it in workspace
ydata = get(a, 'YData'); %% extract the specific data and store it in workspace
close(gcf);

댓글 수: 2

Amirali Kamalian
Amirali Kamalian 2019년 5월 23일
xdata and ydata are identical to XValue and YValue...
Santosh Gnanasekaran
Santosh Gnanasekaran 2019년 5월 23일
편집: Santosh Gnanasekaran 2019년 5월 23일
Yes, once you store these variables in workspace, you can customise the variables. For more info:
Hope this helps.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2019년 5월 23일

편집:

2019년 5월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by