Reputation: 3488
I have a situation where I create a waitbar, read a large image and plot the image to the gui axes. However what happens is that the plot is created inside the waitbar instead.
hWait = waitbar(0,'1','Name','Reading calibration file ...');
% why do I need the '1' in waitbar ???
readCalibrationImage( handles );
% delete( hWait );
set(handles.figure1,'CurrentAxes',handles.axesROI)
plotROIImage( handles, imagedata, roi, lineV, lineH, doExportPlot )
only if I delete the handle the plot is created in the correct window.
How do I enfore plotting to the correct window?
Upvotes: 4
Views: 669
Reputation: 38052
Try putting a
set(0, 'CurrentFigure', handles.figure1);
in front of the CurrentAxes
statement. AFAIK, set(...,'CurrentAxes')
does not automatically switch the active figure...
Upvotes: 3