[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: refreshdata over a plot handle ?
From: |
Ben Abbott |
Subject: |
Re: refreshdata over a plot handle ? |
Date: |
Sun, 24 Feb 2013 09:00:24 -0500 |
On Feb 24, 2013, at 7:43 AM, bob wrote:
> Hi,
>
> I am trying to do this:
>
> scatter(dataPts(:,1),dataPts(:,2));
> hold on;
> plot(0,0,'xDataSource','curveFitPts(:,1)','yDataSource','curveFitPts(:,2)');
> hold off;
> # later in a loop..
> refreshdata(gcf(),'caller');
> drawnow;
>
> But the problem is, calling refreshdata over the figure handle removes the
> earlier scatter plot also.
>
> I guess if there would be a way to simply do a refreshdata over a plot handle
> rather than the entire figure would keep the scatter plot permanently. Any
> body know how to do that ?
>
> --
> bob
I think you'll need to "hold on" in order to preserve the other plot objects.
scatter(dataPts(:,1),dataPts(:,2));
hold on;
plot(0,0,'xDataSource','curveFitPts(:,1)','yDataSource','curveFitPts(:,2)');
hold off;
# later in a loop..
hold on;
refreshdata(gcf(),'caller');
hold off;
drawnow;
Ben