Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
drawnow and hold on together?

Subject: drawnow and hold on together?

From: Elnaz

Date: 3 Oct, 2012 16:50:08

Message: 1 of 2

Hi all,

Can we use "hold on" and "drawnow" together in one plot?
I want to have a curve #1 fixed and then frequently update a curve #2 against the first one. How should I do that?

Thanks,
Elnaz

Subject: drawnow and hold on together?

From: dpb

Date: 3 Oct, 2012 17:02:48

Message: 2 of 2

On 10/3/2012 11:50 AM, Elnaz wrote:
> Hi all,
> Can we use "hold on" and "drawnow" together in one plot?
> I want to have a curve #1 fixed and then frequently update a curve #2
> against the first one. How should I do that?

Read the section on "Animation" in the Graphics documentation.

For that kind of operation set()'ing the YData array of the second curve
will be much faster than redrawing the whole plot.

There's no magic about 'hold' and 'drawnow' other than using them at the
proper time(s) to get the effect desired. Setting the actual data using
the object handle eliminates the need for drawnow anyway, in most cases
at least.

--

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us