Clear Filters
Clear Filters

Uicontrol with callback - how can I stop it from opening a new figure?

1 view (last 30 days)
Hi.
I have this part of a code
uicontrol('Style', 'slider',...
'Min',1,'Max',tot_frames,'Value',1,'SliderStep',[(1/(tot_frames - 1)) 0.1],...
'Position', [300 20 200 20],...
'Callback', {@framecount, wrap_objects, marker_objects, muscle_objects, ...
R_objects, point_objects, glenoid_data, glen_rim, activation_data, to_plot,...
thorax, spine, clavicle, scapula, humerus, radius, ulna, GH_F, flag, hh_data,...
Ggh_resultant,Elb_resultant,GHRC,JforcesGLOBAL});
I basically have an image for a motion that occurs in more than 100 frames and for each of them I display some results (3 suplots) . Is there any way in which I can just go smoothly through the slider and all my other images will change accordingly? Now when I go into one position for the slider, a new figure appears with the images at the right frame.
  2 Comments
Allen
Allen on 1 Mar 2021
Andra,
Though it is not inlcluded in the sample code snippet, it appears that the issue may be in the line(s) of code that you use to display your images. If you are using imshow, or something similar, try adding the axes handle(s) as the first input.
% Basic usage of imshow
I % your image data variable
imshow(I)
% Assigning to a specific axes
hAx % your axes handle
imshow(hAx, I)
Andra Topan
Andra Topan on 2 Mar 2021
You're right. I found it in the end. It was, like you said, in the code used to display the images. I had another "figure" line there. Solved it with figure=gcf.

Sign in to comment.

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!