Matlab 如何在更新绘图时固定背景图片?
我知道如何更新Matlab绘图中的数据并实时绘图;然而,我不知道如何在更新时保持我的背景。有人能帮我吗Matlab 如何在更新绘图时固定背景图片?,matlab,matlab-figure,Matlab,Matlab Figure,我知道如何更新Matlab绘图中的数据并实时绘图;然而,我不知道如何在更新时保持我的背景。有人能帮我吗 ---------------------------------------- x=[0 2000]; y=[0 180e3]; xlim(x) ylim(y) I=imread('MAP.png'); %Flip the image imagesc(x, y, flipud(I)); %Fix the axes set(gca,'ydir','normal'); % hold on;
----------------------------------------
x=[0 2000];
y=[0 180e3];
xlim(x)
ylim(y)
I=imread('MAP.png');
%Flip the image
imagesc(x, y, flipud(I));
%Fix the axes
set(gca,'ydir','normal');
% hold on;
for i=1:2000
PlotUpdate(t(i),p(i))
grid on
pause(0.01);
end
----------------------------------------
%-------- Function is:
function PlotUpdate(speed,power)
h = plot(speed,power,'or','MarkerSize',5,'MarkerFaceColor','r');
h.XData = speed;
h.YData = power;
refreshdata(h,'caller')
end
- 当我激活“保持”命令时,它将显示背景+所有2000点按功能打印(PlotUpdate)
- 当我取消保持时,我的背景图片消失了,我只能看到绘图中的2000点李>
提前感谢,如链接副本中所示,您希望在更新循环外调用
h=plot(…
调用,然后更新循环内h
的值。如链接副本中所示,您希望进行h=plot(…
在更新循环外调用,然后更新循环内h
的值。