【发布时间】:2016-06-16 13:20:42
【问题描述】:
我有一个带有两个按钮的简单 GUI。其中一个是绘制一个图,一个是绘制两个子图。但是,一旦我按下 subplot 选项,我就无法回到单个情节。我收到一个错误:
使用坐标区时出错,对象句柄无效
请看下面我的非常简单的例子:
function plot_push1_Callback(hObject, eventdata, handles)
load('test.mat')
axes(handles.axes1)
cla(handles.axes1,'reset')
plot(x,x.^(n+1));
function push_plot2_Callback(hObject, eventdata, handles)
load('test.mat')
axes(handles.axes1)
cla(handles.axes1,'reset')
subplot(2,1,1);
plot(x,x.^(0));
subplot(2,1,2);
plot(x,x);
【问题讨论】:
-
我之前没有设计过图形用户界面,但
subplot(1,1,1)可以工作吗? -
我试过了,没用:(
-
你可以试试
clf。 -
我也试过
clf,它正在清除整个界面。
标签: matlab matlab-figure matlab-guide subplot