情节是在错误的gui窗口中创建的

时间:2013-01-10 09:24:48

标签: matlab user-interface

我有一种情况,我创建一个等待栏,读取一个大图像并将图像绘制到gui轴。然而,会发生的是,情节是在等待条内创建的。

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 )            

只有当我删除手柄时才会在正确的窗口中创建绘图。

如何绘制到正确的窗口?

1 个答案:

答案 0 :(得分:3)

尝试添加

set(0, 'CurrentFigure', handles.figure1);

CurrentAxes语句前面。 AFAIK,set(...,'CurrentAxes')不会自动切换活动数字......