How can I select a point in the figure by mouse?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi Matlab experts,
I would like to plot (in 3D) a number of points which are selectable from the figure. Please see the image attached (EEG_cap.bmp). I have all coordinates (X,Y,Z) and I can plot it using plot3d function. However, I want a way that enables the user to select each (one or more) of these points (electrodes) by mouse. For example, by clicking on each of them the color turns red and allows user to know that these point are selected for further operations. At the same time the system saves those channels name.
I really appreciate any hint.
Best... :-)
"This figure is originally generated by EEGLAB"
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149997/image.bmp)
0 件のコメント
回答 (2 件)
David Sanchez
2013 年 9 月 23 日
You need to make use of
datacursormode
and
getCursorInfo
functions. Look in matlab help for examples on how to use them and retreive cursor position/data.
0 件のコメント
Arthur
2013 年 9 月 23 日
I would make use of the buttondownFcn of the line.
The easiest if you make each point a separate object (e.g. a line). Than the ButtonDownFcn can be as easy as:
set(hObject,'MarkerFaceColor','r')
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Visual Exploration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!