how to see my plot in GUI axes.
Afficher commentaires plus anciens
I have a GUI using Guide. Now in a button callback I am calling a function Test.m, which creates a plot. The plot is being created in a figure and not in axes, though I used.
axes(handles.axes1);
%imshow(figure(1));
Code for the Button callback goes here:
function calculate_Callback(hObject, eventdata, handles)
axes(handles.axes1);
%imshow(figure(1));
Test;
imshow(Test);
Help!
[EDITED, Jan, code formatted - please follow the "? Help" link]
Réponses (1)
Jan
le 30 Avr 2013
Without seeing the contents of Test.m, we cannot know why a new figure is created. Perhaps there is a figure() command in this function?
You start Test twice - is this intented?
The most secure method to specify the parent axes (and in consequence the parent figure also) is to define this explicitly:
function Test(AxesHandle)
plot(AxesHandle, 1:10, rand(10, 10))
end
Then changes of the current AXES object by a TIMER callback or user interaction do not have any influence anymore.
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!