help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hold on and hold off in octave-2.9.8


From: Joe Koski
Subject: Re: Hold on and hold off in octave-2.9.8
Date: Sat, 09 Sep 2006 14:30:13 -0600
User-agent: Microsoft-Entourage/11.2.5.060620

on 9/9/06 2:09 PM, John W. Eaton at address@hidden wrote:

> On  9-Sep-2006, Joe Koski wrote:
> 
> | Hi all,
> | 
> | I have a loop in one of my scripts:
> | 
> | for i = 1:num_c2f
> |   ifig = ifig + 1;
> |   figure(ifig);
> |   clg;
> |   legend('off');
> |   axis('auto');
> |   title(['Coarse to Fine ',int2str(i),' vs. Signal']);
> |   xlabel ("Time, s")
> |   ylabel ("Amplitude")
> |   hold on;
> |   plot(t,x,'r');
> |   plot(t,c2f(i,:),'b');
> |   hold off;
> | end
> | 
> | With octave-2.1.73, the "hold on" and "hold off" serve to superimpose the
> | two plot commands onto one plot frame. With octave-2.9.8, only the second
> | plot appears in the axes, and the first plot disappears. This is all on my
> | Mac with octave builds from scratch on OS X 10.4.7, Xcode-2.4, etc.
> | 
> | Has the use of "hold on" changed?
> 
> It should not have changed.
> 
> I can't run your code above since I don't have all the data required,
> but the following works for me:
> 
>   x = linspace (-10, 10, 200)';
>   hold on
>   plot (x, sin (x));
>   plot (x, cos (x));
>   hold off
> 
> Does this work for you?
> 
> jwe

John,

Yes, the simple test works correctly on my machine, both when I paste
line-by-line, and when I place the commands in a simple test_hold_on.m file.

I'll be in and out today, but I can try things like constructing a test loop
and placing other items like legend() inside the loop. It takes my code
about 5 minutes to get to that sequence of plots, so I need to come up with
a faster case for debugging that still replicates the problem.

This is the second time that this has happened, but the loops are very
similar.

When I combined the plot commands into a single plot command, I did get what
I wanted.

Joe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]