time | calls | line |
---|
| | 1 | function holdstate = ishold(ca)
|
| | 2 | %ISHOLD Return hold state.
|
| | 3 | % ISHOLD returns 1 if hold is on, and 0 if it is off.
|
| | 4 | % When HOLD is ON, the current plot and all axis properties
|
| | 5 | % are held so that subsequent graphing commands add to the
|
| | 6 | % existing graph.
|
| | 7 | %
|
| | 8 | % Hold on means the NextPlot property of both figure
|
| | 9 | % and axes is set to "add".
|
| | 10 | %
|
| | 11 | % See also HOLD, NEWPLOT, FIGURE, AXES.
|
| | 12 |
|
| | 13 | % Copyright 1984-2003 The MathWorks, Inc.
|
| | 14 |
|
| | 15 | %ISHOLD(AXH) returns whether hold is on for the specified axis
|
| | 16 |
|
0.01 | 6613 | 17 | if nargin<1
|
| | 18 | cf = gcf;
|
| | 19 | ca = get(cf,'currentaxes');
|
| | 20 | if isempty(ca)
|
| | 21 | holdstate = 0;
|
| | 22 | return;
|
| | 23 | end
|
0.01 | 6613 | 24 | else
|
0.09 | 6613 | 25 | ca=ca(1);
|
0.25 | 6613 | 26 | cf = ancestor(ca,'figure');
|
0.02 | 6613 | 27 | end
|
| | 28 |
|
0.57 | 6613 | 29 | holdstate = strcmp(get(ca,'nextplot'),'add') & ...
|
0.03 | 6613 | 30 | strcmp(get(cf,'nextplot'),'add');
|