我在更新子图时遇到问题。我煮了我的问题,下面的这个例子:Matlab更新子图并保留
win = figure(1);
win.sub1 = subplot(2, 2, 1);
win.sub2 = subplot(2, 2, 2);
win.sub3 = subplot(2, 2, 3);
win.sub4 = subplot(2, 2, 4);
x = 1:1:10;
plot(win.sub2, x, x); %graphs the line y = x in the second subplot, good.
hold on;
plot(win.sub2, x, -x) %ought to plot line y = -x over line y = x, but does not.
当执行第二曲线,第一曲线,尽管上保持消失。似乎使这项工作的唯一事情是如果我使用坐标轴(win.sub2),但我试图避免这种情况,因为它确实会减慢我的程序(绘制一个图上的4个子图,每个子图都有大约2个重叠的图,创建一个1000 +帧电影)。我很感激任何帮助。谢谢
非常感谢你,我不知道,保持并没有简单地应用于所有轴... –