Mercurial > hg > octave-nkf
annotate scripts/plot/util/closereq.m @ 18746:29f00c0d0657
Fix double '-P' in print command to printer (bug #41957).
* print.m: Expand documentation of latex and latexstandalone options.
Change some of the documentation examples to use more useful, modern devices
(jpg instead of HP DeskJet 550C). Use isempty to determine in there is a
figure to print. Remove extra '-P' from print command going directly to
printer.
author | Michael Godfrey <michaeldgodfrey@gmail.com> |
---|---|
date | Tue, 25 Mar 2014 17:00:41 +0000 |
parents | d63878346099 |
children | 4197fc428c7d |
rev | line source |
---|---|
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
17572
diff
changeset
|
1 ## Copyright (C) 2005-2013 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 |