Mercurial > hg > octave-nkf
annotate scripts/plot/closereq.m @ 17530:0f45d9dd8107
test: Fix 4 failing plot demos.
* scripts/plot/legend.m: Demo #11, use 'h' for returned handle.
* scripts/plot/plot.m: Fix typo "lenths" -> "lengths".
* scripts/plot/ribbon.m: Remove unnecessary call to meshgrid now
that sombrero returns meshgridded data.
* scripts/plot/trimesh.m: Set colormap so plot is always reproducible.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 01 Oct 2013 15:39:20 -0700 |
parents | ffa7f1caab4e |
children |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
1 ## Copyright (C) 2005-2012 John W. Eaton |
6257 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
6257 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
6257 | 18 |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Function File} {} closereq () | |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
15466
diff
changeset
|
21 ## Close the current figure and delete all graphics objects associated with it. |
17444
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
22 ## |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
23 ## By default, the @qcode{"closerequestfcn"} property of a new plot figure |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
24 ## points to this function. |
6895 | 25 ## @seealso{close, delete} |
6257 | 26 ## @end deftypefn |
27 | |
28 ## Author: jwe | |
29 | |
30 function closereq () | |
31 | |
17444
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
32 if (nargin != 0) |
6257 | 33 print_usage (); |
34 endif | |
35 | |
17444
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
36 cf = gcbf (); |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
37 if (isempty (cf)) |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
38 warning ("closereq: calling closereq from octave prompt is not supported, use 'close' instead"); |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
39 cf = get (0, "currentfigure"); |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
40 endif |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
41 if (! isempty (cf) && isfigure (cf)) |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
42 delete (cf); |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
43 endif |
ffa7f1caab4e
Clarify relationship of close, closereq.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
44 |
6257 | 45 endfunction |
17338
1c89599167a6
maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
46 |