Info
This question is closed. Reopen it to edit or answer.
Modifying Axes properties from different file than the one it was created in
1 view (last 30 days)
Show older comments
I am working with a simple GUI that has some axes and a push button. Now when the push button is pressed it calls another m file and executes a function, and the results are plotted in figure on the axes. Now what I am trying to do is to modify this axes after the results are plotted. I know I can do this from using set(handles.axes2...., but this can only be used inside the figure file. I want to edit the axes's properties with code in the function file, not the figure file. In more specific terms, I want the syntax to access the axes's handle from outside the file it was created in, (i.e. from the function that performs the calculation)
Thanks
0 Comments
Answers (1)
Walter Roberson
on 25 May 2012
The set() can be done within any function that can find the appropriate handle. This could be by way of passing in the handles structure, or by way of passing in information (such as the figure handle) that allows the handles structure to be retrieved via guidata(), or by way of having the function findobj() the handle using information such as its Tag.
For example if you were using GUIDE, then any of the callbacks that are created with the hObject, event, and handles parameters, could be moved to individual .m files [you would run into difficulties with GUIDE's automatic renaming of functions as needed when the object names change, but MATLAB would be fine to have them in separate .m files]
1 Comment
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!