[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:52:14 -0500 |
On Feb 24, 2013, at 9:14 AM, bob wrote:
> On Sun, Feb 24, 2013 at 7:30 PM, Ben Abbott <address@hidden> wrote:
>
>> 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
>
> Tried it.. doesn't work.
Please keep the mail-list in the loop (reply-all). We prefer bottom posting as
it makes it easier for the reader to follow along.
http://en.wikipedia.org/wiki/Posting_style#Bottom-posting
I don't have your script, so I created a short demo that works for me.
Ben
test_source.m
Description: Binary data