How can I get all properties of some object of UIAXES app designer

3 ビュー (過去 30 日間)
Ron
Ron 2022 年 11 月 14 日
コメント済み: Ron 2022 年 11 月 15 日
Hey ,
I'm creating some points with scatter3 plot on UIAxes , and I am trying that when clicking on some point , the point will change her color , or size or somthing.
When i am doing callback function on the UIAxes I cant click the objects , only when clicking the whitespace of the UIAxes it is jumping to the callback function, How can i fix it ?

回答 (1 件)

Steven Lord
Steven Lord 2022 年 11 月 14 日
If I have a book sitting on a table and I touch the cover of the book, have I touched the table? No. So things that are concerned with the table being touched (someone whose job or chore it is to clean fingerprints off the table, for example) don't get triggered.
If you've specified the Callback for the uiaxes in the scenario you described, you've set the wrong Callback. You've expressed concern for the table being touched (which is why it triggers when you click on the white space in the axes) but you're actually touching the book / scatter plot.
You want to work with the Scatter properties not the uiaxes properties.
  3 件のコメント
Steven Lord
Steven Lord 2022 年 11 月 14 日
The uiaxes callback functions won't trigger when you click on the scatter3 object but the scatter3 object's callback functions would.
x = rand(1, 10);
y = rand(1, 10);
ax = uiaxes;
h = scatter(ax, x, y);
ax.ButtonDownFcn = @(varargin) disp('uiaxes');
h.ButtonDownFcn = @(varargin) disp('scatter');
Run this code in your MATLAB session then click in a blank section of the axes and on one of the points created in the scatter plot.
Ron
Ron 2022 年 11 月 15 日
I doesn't work for me .
I already have UIAxes in the app designer, and the scatter plot is created on the uiaxes in some .m function that i am calling after some button clicked.
To where i should add the 2 last lines? (the 4 lines is not relevant beacuse i already created it )

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by