Discussion:
drawnow and hold on together?
(too old to reply)
Elnaz
2012-10-03 16:50:08 UTC
Permalink
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
dpb
2012-10-03 17:02:48 UTC
Permalink
Post by Elnaz
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.

--

Loading...