mysterymask
2009-03-16, 16:39
我用axes画直线,当我改变直线参数的时候画出了两天直线,具体现象请见附件“画图问题”
我想当直线参数改变后重新画图时,以前的图像消除不显示,我不知道怎么做,请高手帮帮忙啊。
我画线的代码如下:
function drawButton_Callback(hObject, eventdata, handles)
clc;
hold on;
axis equal;
grid on;
x1 = str2double(get(handles.P1X_edit,'string'));
y1 = str2double(get(handles.P1Y_edit,'String'));
x2 = str2double(get(handles.P2X_edit,'String'));
y2 = str2double(get(handles.P2Y_edit,'String'));
plot([x1 x2],[y1 y2]);
hold off;
我想当直线参数改变后重新画图时,以前的图像消除不显示,我不知道怎么做,请高手帮帮忙啊。
我画线的代码如下:
function drawButton_Callback(hObject, eventdata, handles)
clc;
hold on;
axis equal;
grid on;
x1 = str2double(get(handles.P1X_edit,'string'));
y1 = str2double(get(handles.P1Y_edit,'String'));
x2 = str2double(get(handles.P2X_edit,'String'));
y2 = str2double(get(handles.P2Y_edit,'String'));
plot([x1 x2],[y1 y2]);
hold off;