Mercurial > hg > octave-lyh
annotate scripts/plot/gnuplot_binary.in @ 17130:26589abbc78d
Don't pass axis handle unnecessarily from high level to low level plot functions.
* scripts/plot/comet.m, scripts/plot/comet3.m, scripts/plot/compass.m,
scripts/plot/contour.m, scripts/plot/contourf.m, scripts/plot/cylinder.m,
scripts/plot/ellipsoid.m, scripts/plot/errorbar.m, scripts/plot/feather.m,
scripts/plot/mesh.m, scripts/plot/meshc.m, scripts/plot/meshz.m,
scripts/plot/pcolor.m, scripts/plot/plot3.m, scripts/plot/rectangle.m,
scripts/plot/rose.m, scripts/plot/scatter3.m, scripts/plot/semilogxerr.m,
scripts/plot/semilogy.m, scripts/plot/semilogyerr.m, scripts/plot/slice.m,
scripts/plot/sphere.m, scripts/plot/stairs.m, scripts/plot/surf.m,
scripts/plot/surfc.m, scripts/plot/surfnorm.m, scripts/plot/trimesh.m,
scripts/plot/trisurf.m: Don't pass hax to lower level functions after
newplot() has been called.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 31 Jul 2013 18:42:17 -0700 |
parents | 3cce6b4e0f7c |
children | 4d7f95eb8bfe |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
12215
diff
changeset
|
1 ## Copyright (C) 2008-2012 John W. Eaton |
7361 | 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 | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
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 | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
20 ## @deftypefn {Loadable Function} {[@var{prog}, @var{args}] =} gnuplot_binary () |
9467
49f890499ebc
fix typo in gnuplot_binary
Jaroslav Hajek <highegg@gmail.com>
parents:
9461
diff
changeset
|
21 ## @deftypefnx {Loadable Function} {[@var{old_prog}, @var{old_args}] =} gnuplot_binary (@var{new_prog}, @var{arg1}, @dots{}) |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
22 ## Query or set the name of the program invoked by the plot command |
12215
4ae2a74ed04c
Add fltk_gui_mode, fltk_mouse_wheel_zoom to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11563
diff
changeset
|
23 ## when the graphics toolkit is set to "gnuplot". Additional arguments to |
4ae2a74ed04c
Add fltk_gui_mode, fltk_mouse_wheel_zoom to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11563
diff
changeset
|
24 ## pass to the external plotting program may also be given. |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
25 ## The default value is @code{"gnuplot"} with no additional arguments. |
12215
4ae2a74ed04c
Add fltk_gui_mode, fltk_mouse_wheel_zoom to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11563
diff
changeset
|
26 ## @xref{Installation}. |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
27 ## @seealso{graphics_toolkit} |
7361 | 28 ## @end deftypefn |
29 | |
30 ## Author: jwe | |
31 | |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
32 function [prog, args] = gnuplot_binary (new_prog, varargin) |
7361 | 33 |
34 persistent gp_binary = %OCTAVE_CONF_GNUPLOT%; | |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
35 persistent gp_args = {}; |
7361 | 36 |
37 if (nargout > 0 || nargin == 0) | |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
38 prog = gp_binary; |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
39 args = gp_args; |
7361 | 40 endif |
41 | |
42 if (nargin == 1) | |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
43 if (! ischar (new_prog) || isempty (new_prog)) |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
44 error ("gnuplot_binary: NEW_PROG must be a non-empty string"); |
7361 | 45 endif |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
46 gp_binary = new_prog; |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
47 endif |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
48 |
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
49 if (nargin > 1) |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
50 if (! iscellstr (varargin)) |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
51 error ("gnuplot_binary: arguments must be character strings"); |
9461
ff8d7f3ad203
gnuplot_binary.m: accept arguments in addition to program name
John W. Eaton <jwe@octave.org>
parents:
7361
diff
changeset
|
52 endif |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
53 gp_args = varargin; |
7361 | 54 endif |
55 | |
56 endfunction | |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
57 |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
58 |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
59 %!test |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
60 %! orig_val = gnuplot_binary (); |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
61 %! old_val = gnuplot_binary ("X"); |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
62 %! assert (orig_val, old_val); |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
63 %! assert (gnuplot_binary (), "X"); |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
64 %! gnuplot_binary (orig_val); |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
65 %! assert (gnuplot_binary (), orig_val); |