From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to stop graphics refresh
Date: Fri, 11 Jul 2008 11:31:02 +0000 (UTC)
Organization: Simrad AS
Lines: 58
Message-ID: <g57g9m$ap5$>
References: <g4gl79$e9t$> <g4gnm6$cnk$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1215775862 11045 (11 Jul 2008 11:31:02 GMT)
NNTP-Posting-Date: Fri, 11 Jul 2008 11:31:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1411056
Xref: comp.soft-sys.matlab:478825

If only it was that good... The figure always has to be 
visible as it is part of an animation. I am becoming more 
and more convinced that the error lies somewhere else. I 
tested it with following one-liner:

i = 0:0.01:2*pi; h = plot(sin(i)); drawnow; while(true), 
for j = 0:0.01:2*pi; set(h, 'YData', sin(i-j));  end; end

If the figure updated itself without explicit call to 
drawnow, the line would produce a running sinus wave. 
However, the figure updates itself only once, when the 
first sinus is drawn. On the other hand, 

i = 0:0.01:2*pi; h = plot(sin(i)); drawnow; while(true), 
for j = 0:0.01:2*pi; set(h, 'YData', sin(i-j));  drawnow; 
end; end

(added "drawnow" just before "end; end") successfully 
produces a running sinus wave.

Well, thanks for your time anyway :=)

best regards, Aleksander (Walter Roberson) wrote in 
message <g4gnm6$cnk$>...
> In article <g4gl79$e9t$>,
> Aleks  <> wrote:
> >Does anyone know if there is a way to stop refreshing 
> >graphics in matlab? I have a quite complex graphics 
> >program, and it looks like the figure sometimes updates 
> >between calls to drawnow. It makes the image flicker.
> Does the figure need to be visible during the update? 
> I guess if flickering is a problem then Yes, but if it 
> happen to need to be visible during the update, set the 
> visibility off, do the update, and then set the figure 
> on.
> If the figure does need to be visible, then you could do 
a double-figure
> process: when you want to do the update, create an 
invisible figure,
> do all the graphics writing to it, and when it is done, 
make the
> new figure visible and the old figure invisible.
> -- 
>   "To burn always with this hard, gem-like flame, to 
maintain this
>   ecstasy, is success in life."               -- Walter