How to store a selected axes-point in handles
14 ビュー (過去 30 日間)
古いコメントを表示
Hello fellow Matlab-Users,
This is what i want:
- User selects a point in an axes_object.
- My program stores selected point in my figure's handles_object.
My first approach was to use the datacursormode's UpdateFcn to extract the data. I couldn't find a solution to the problem, that i can't reach the handles_object from the UpdateFcn.
My second approach was to write my own datacursormode. The new problem is, that i can't catch the ButtonDownFcn_trigger of my axes_object. Now im not sure if that is because the axes_object is located inside a panel inside a figure. Or because "Some Plotting Functions Reset the ButtonDownFcn" as i read in the axes_properties_docu.
Now i really search for some advice how to get that *** Coordinates.
Best regards, Peter
This is the most useful help i found so far:
0 件のコメント
採用された回答
Walter Roberson
2011 年 9 月 23 日
Within your UpdateFcn callback, if you named the first parameter as hObject, then
ancestor(hObject, 'figure')
gets you the handle of the object's figure.
If by handles_object you are referring to "handles" such as is commonly passed around in GUIDE created programs, then just use
handles = guidata(hObject);
guidata() knows enough to climb the parent chain of the object it is given to find the parent figure.
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!