Plot problem. Hold on active between re-runs.

View: New views
5 Messages — Rating Filter:   Alert me  

Plot problem. Hold on active between re-runs.

by Nose Nada :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello there!
I'm using Octave 3.0 (running on Fedora 8). I have several plots in the same figure thanks to hold on. However, when I close the figure and re-run my function the old plots appears in the new graph together with the new plots. They accumulate along runs of my function. If I remove hold on I solve this problem but I lose the capability of multiple plots in the same graph in a single run. If instead I use hold off after the plotting instructions in a single run, I keep having the accumulation problem. If I close and restart Octave the first run comes with no old plots but the second already accumulates.
How can I get rid of the accumulation problem?
Thanks in advance,
Omar

Re: Plot problem. Hold on active between re-runs.

by kensmith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 01 May 2008 13:57, Nose Nada wrote:

> Hello there!
> I'm using Octave 3.0 (running on Fedora 8). I have several plots in
> the same figure thanks to hold on. However, when I close the figure
> and re-run my function the old plots appears in the new graph
> together with the new plots. They accumulate along runs of my
> function. If I remove hold on I solve this problem but I lose the
> capability of multiple plots in the same graph in a single run. If
> instead I use hold off after the plotting instructions in a single
> run, I keep having the accumulation problem. If I close and restart
> Octave the first run comes with no old plots but the second already
> accumulates.
> How can I get rid of the accumulation problem?
> Thanks in advance,
> Omar

hold on
and
hold off

work like flipping a flip-flop back and forth.  If you say

hold off
plot ....
hold on
plot ...
hold on
plot ....
hold on

you will build up only those plots.  The extra "hold on" commands do
nothing bad.



--
kensmith99@...
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Plot problem. Hold on active between re-runs.

by Nose Nada :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Ken for your suggestion. I managed to solve this problem with the command clf.
Omar



kensmith wrote:
On Thursday 01 May 2008 13:57, Nose Nada wrote:
> Hello there!
> I'm using Octave 3.0 (running on Fedora 8). I have several plots in
> the same figure thanks to hold on. However, when I close the figure
> and re-run my function the old plots appears in the new graph
> together with the new plots. They accumulate along runs of my
> function. If I remove hold on I solve this problem but I lose the
> capability of multiple plots in the same graph in a single run. If
> instead I use hold off after the plotting instructions in a single
> run, I keep having the accumulation problem. If I close and restart
> Octave the first run comes with no old plots but the second already
> accumulates.
> How can I get rid of the accumulation problem?
> Thanks in advance,
> Omar

hold on
and
hold off

work like flipping a flip-flop back and forth.  If you say

hold off
plot ....
hold on
plot ...
hold on
plot ....
hold on

you will build up only those plots.  The extra "hold on" commands do
nothing bad.



--
kensmith99@comcast.net
_______________________________________________
Help-octave mailing list
Help-octave@octave.org
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Plot problem. Hold on active between re-runs.

by bharat pathak :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Ken,

>From now on you always do like this,

figure; clf; hold on;
plot(...
plot(...
plot(...
hold off;

figure; clf; hold on;
plot(...
plot(...
plot(...
hold off;

This will solve your problem and resolve stikiness phenomena.

rgds
bharat


----- Original Message -----
From: "kensmith" <kensmith99@...>
To: <help-octave@...>
Sent: Friday, May 02, 2008 7:03 PM
Subject: Re: Plot problem. Hold on active between re-runs.


> On Thursday 01 May 2008 13:57, Nose Nada wrote:
>> Hello there!
>> I'm using Octave 3.0 (running on Fedora 8). I have several plots in
>> the same figure thanks to hold on. However, when I close the figure
>> and re-run my function the old plots appears in the new graph
>> together with the new plots. They accumulate along runs of my
>> function. If I remove hold on I solve this problem but I lose the
>> capability of multiple plots in the same graph in a single run. If
>> instead I use hold off after the plotting instructions in a single
>> run, I keep having the accumulation problem. If I close and restart
>> Octave the first run comes with no old plots but the second already
>> accumulates.
>> How can I get rid of the accumulation problem?
>> Thanks in advance,
>> Omar
>
> hold on
> and
> hold off
>
> work like flipping a flip-flop back and forth.  If you say
>
> hold off
> plot ....
> hold on
> plot ...
> hold on
> plot ....
> hold on
>
> you will build up only those plots.  The extra "hold on" commands do
> nothing bad.
>
>
>
> --
> kensmith99@...
> _______________________________________________
> Help-octave mailing list
> Help-octave@...
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>


--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG.
Version: 8.0.100 / Virus Database: 269.23.7/1410 - Release Date: 01-05-2008
17:30

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Plot problem. Hold on active between re-runs.

by kensmith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think you missed the point of my suggestion.  I will explain it a bit
more down there where the suggestion text is.

On Friday 02 May 2008 07:11, bharat pathak wrote:

> Hello Ken,
>
> From now on you always do like this,
>
> figure; clf; hold on;
> plot(...
> plot(...
> plot(...
> hold off;
>
> figure; clf; hold on;
> plot(...
> plot(...
> plot(...
> hold off;
>
> This will solve your problem and resolve stikiness phenomena.
>
> rgds
> bharat
>
>
> ----- Original Message -----
> From: "kensmith" <kensmith99@...>
> To: <help-octave@...>
> Sent: Friday, May 02, 2008 7:03 PM
> Subject: Re: Plot problem. Hold on active between re-runs.
>
> > On Thursday 01 May 2008 13:57, Nose Nada wrote:
> >> Hello there!
> >> I'm using Octave 3.0 (running on Fedora 8). I have several plots
> >> in the same figure thanks to hold on. However, when I close the
> >> figure and re-run my function the old plots appears in the new
> >> graph together with the new plots. They accumulate along runs of
> >> my function. If I remove hold on I solve this problem but I lose
> >> the capability of multiple plots in the same graph in a single
> >> run. If instead I use hold off after the plotting instructions in
> >> a single run, I keep having the accumulation problem. If I close
> >> and restart Octave the first run comes with no old plots but the
> >> second already accumulates.
> >> How can I get rid of the accumulation problem?
> >> Thanks in advance,
> >> Omar
> >
> > hold on
> > and
> > hold off
> >
> > work like flipping a flip-flop back and forth.  If you say
> >
> > hold off
> > plot ....
> > hold on
> > plot ...
> > hold on
> > plot ....
> > hold on
> >
> > you will build up only those plots.  The extra "hold on" commands
> > do nothing bad.

I was explaining how the "hold" function operated.  The example I gave
was to help to understand the operation.  The "plot" and "hold on" in
the actual case I did were inside a loop.  Repeating the "hold on"
command does nothing good or bad so it can be repeated if that makes
the code easier to do.


> >
> >
> >
> > --
> > kensmith99@...
> > _______________________________________________
> > Help-octave mailing list
> > Help-octave@...
> > https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
> ---------------------------------------------------------------------
>-----------
>
>
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 8.0.100 / Virus Database: 269.23.7/1410 - Release Date:
> 01-05-2008 17:30

--
kensmith99@...
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave