How to create large figure from GUI axes?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi guys
I have a very simple GUI made in guide where i have a plot function initiated by a pushbutton which plots a scatter plot in axes (called Method1axes1):
handles.plot = scatter(X,Y, 'parent', handles.Method1axes1);
Now I want the user to be able to click the axes (plot) to get en new larger figure. I tried the below code which is working if i DON'T plot in the axes first. As soon as I run the plot function the scatterplot appears in Method1axes1 but I can no longer click the figure.
% --- Executes on mouse press over axes background.
function Method1axes1_ButtonDownFcn(hObject, eventdata, handles)
figure
scatter(X,Y);
What am I doing wrong?
0 Commenti
Risposte (1)
Rik
il 16 Dic 2018
Many functions that place content in an axis will reset a lot of properties. As an example: imshow will wipe most properties of its parent axis, while the image function will not. One of the properties that is removed often is the ButtonDownFcn (along with the other interaction callbacks), so you should check if that property is still as it should be.
You can try to prevent this by using hold on (or setting the NextPlot property of your axes obect), or setting the callback property every time you plot your data.
2 Commenti
Rik
il 16 Dic 2018
You wrote some code. What did you write exactly? Which of my two suggestions did you try?
Also, please don't post the entire code in a comment, but attach it as an m-file. GUIDE makes for extremely bloaty code.
Vedere anche
Categorie
Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!