Thread Subject:
How to test for "hold all" vs "hold on"

Subject: How to test for "hold all" vs "hold on"

From: Carl Witthoft

Date: 9 Jul, 2012 17:13:15

Message: 1 of 6

The function "ishold" will tell you if "hold" is active or not, but I don't see any way to tell whether "hold on" or "hold all" was invoked. Is there a simple way, or is it necessary to dig down to some "ColorOrder" or "LineStyleOrder" parameter value to find out?

thanks in advance
Carl

Subject: How to test for "hold all" vs "hold on"

From: dpb

Date: 9 Jul, 2012 17:53:07

Message: 2 of 6

On 7/9/2012 12:13 PM, Carl Witthoft wrote:
> The function "ishold" will tell you if "hold" is active or not, but I
> don't see any way to tell whether "hold on" or "hold all" was invoked.
> Is there a simple way, or is it necessary to dig down to some
> "ColorOrder" or "LineStyleOrder" parameter value to find out?
>

hold on|off change the axis 'nextplot' property between 'add|replace'

'all' isn't implemented in my version and the current doc doesn't say
but the first thing to do is to execute it and see what

get(gca,'nextplot')

returns. If it's not distinguishable then it's a query for Tech Support
as it's undocumented as to how to know afaict.

--

Subject: How to test for "hold all" vs "hold on"

From: Doug Schwarz

Date: 9 Jul, 2012 18:12:57

Message: 3 of 6

On 7/9/2012 1:13 PM, Carl Witthoft wrote:
> The function "ishold" will tell you if "hold" is active or not, but I
> don't see any way to tell whether "hold on" or "hold all" was
> invoked. Is there a simple way, or is it necessary to dig down to some
> "ColorOrder" or "LineStyleOrder" parameter value to find out?
>
> thanks in advance
> Carl

A quick look at hold.m tells us that

   getappdata(gca,'PlotHoldStyle')

will be true for 'hold all', false for 'hold on' and empty if hold
hasn't been set at all.


--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: How to test for "hold all" vs "hold on"

From: Carl Witthoft

Date: 9 Jul, 2012 18:38:07

Message: 4 of 6

Unfortunately, this is only true for a "fresh" plot window. Once "hold off" has been called, regardless of whether anything has been plotted, the status will exist and be zero.
 From my console session:

>> hold off
>> getappdata(gca,'PlotHoldStyle')
ans =
     0
>> hold on
>> getappdata(gca,'PlotHoldStyle')
ans =
     0

Doug Schwarz <see@sig.for.address.edu> wrote in message <jtf6vc$82l$1@dont-email.me>...
> On 7/9/2012 1:13 PM, Carl Witthoft wrote:
> > The function "ishold" will tell you if "hold" is active or not, but I
> > don't see any way to tell whether "hold on" or "hold all" was
> > invoked. Is there a simple way, or is it necessary to dig down to some
> > "ColorOrder" or "LineStyleOrder" parameter value to find out?
> >
> > thanks in advance
> > Carl
>
> A quick look at hold.m tells us that
>
> getappdata(gca,'PlotHoldStyle')
>
> will be true for 'hold all', false for 'hold on' and empty if hold
> hasn't been set at all.
>
>
> --
> Doug Schwarz
> dmschwarz&ieee,org
> Make obvious changes to get real email address.
>

Subject: How to test for "hold all" vs "hold on"

From: Doug Schwarz

Date: 9 Jul, 2012 18:54:09

Message: 5 of 6

[top posting repaired]

On 7/9/2012 2:38 PM, Carl Witthoft wrote:
> Doug Schwarz <see@sig.for.address.edu> wrote in message
> <jtf6vc$82l$1@dont-email.me>...
>> On 7/9/2012 1:13 PM, Carl Witthoft wrote:
>> > The function "ishold" will tell you if "hold" is active or not, but I
>> > don't see any way to tell whether "hold on" or "hold all" was
>> > invoked. Is there a simple way, or is it necessary to dig down to
>> some
>> > "ColorOrder" or "LineStyleOrder" parameter value to find out?
>> >
>> > thanks in advance
>> > Carl
>>
>> A quick look at hold.m tells us that
>>
>> getappdata(gca,'PlotHoldStyle')
>>
>> will be true for 'hold all', false for 'hold on' and empty if hold
>> hasn't been set at all.
>>

 > Unfortunately, this is only true for a "fresh" plot window. Once "hold
 > off" has been called, regardless of whether anything has been plotted,
 > the status will exist and be zero.
 > From my console session:
 >
 >>> hold off
 >>> getappdata(gca,'PlotHoldStyle')
 > ans =
 > 0
 >>> hold on
 >>> getappdata(gca,'PlotHoldStyle')
 > ans =
 > 0

Are you asking which version of hold was used on a plot that no longer
has either one? In other words, do you want to know which code was run,
A or B:

A: hold on, hold off
B: hold all, hold off

or do you simply need to know which of the 3 states you are in:

1: hold on
2: hold all
3: hold off

I don't know how to answer the former, but the latter is easily obtained
from getappdata and ishold.


--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: How to test for "hold all" vs "hold on"

From: Carl Witthoft

Date: 9 Jul, 2012 19:09:07

Message: 6 of 6

Doug Schwarz <see@sig.for.address.edu> wrote in message <jtf9cl$nms$1@dont-email.me>...
> On 7/9/2012 2:38 PM, Carl Witthoft wrote:
> > Doug Schwarz <see@sig.for.address.edu> wrote in message
> > <jtf6vc$82l$1@dont-email.me>...
> >> On 7/9/2012 1:13 PM, Carl Witthoft wrote:
> >> > The function "ishold" will tell you if "hold" is active or not, but I
> >> > don't see any way to tell whether "hold on" or "hold all" was
> >> > invoked. Is there a simple way, or is it necessary to dig down to
> >> some
> >> > "ColorOrder" or "LineStyleOrder" parameter value to find out?
> >> >
> >> > thanks in advance
> >> > Carl
> >>
> >> A quick look at hold.m tells us that
> >>
> >> getappdata(gca,'PlotHoldStyle')
> >>
> >> will be true for 'hold all', false for 'hold on' and empty if hold
> >> hasn't been set at all.
> >>
>
> > Unfortunately, this is only true for a "fresh" plot window. Once "hold
> > off" has been called, regardless of whether anything has been plotted,
> > the status will exist and be zero.
> > From my console session:
> >
> >>> hold off
> >>> getappdata(gca,'PlotHoldStyle')
> > ans =
> > 0
> >>> hold on
> >>> getappdata(gca,'PlotHoldStyle')
> > ans =
> > 0
>
> Are you asking which version of hold was used on a plot that no longer
> has either one? In other words, do you want to know which code was run,
> A or B:
>
> A: hold on, hold off
> B: hold all, hold off
>
> or do you simply need to know which of the 3 states you are in:
>
> 1: hold on
> 2: hold all
> 3: hold off
>
> I don't know how to answer the former, but the latter is easily obtained
> from getappdata and ishold.
>
Yes, I wanted to determine which of the 3 states was current. I'd overlooked exactly when PlotHoldData was toggling. Thanks for pointing out the obvious :-).

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
graphics hold isho... Carl Witthoft 9 Jul, 2012 13:14:13
rssFeed for this Thread

Contact us