Mercurial > hg > octave-lyh
annotate scripts/plot/private/__gnuplot_version__.m @ 17320:088d014a7fe2
Use semicolon after "return" statement in core m-files.
* scripts/general/accumdim.m, scripts/image/imformats.m, scripts/io/textread.m,
scripts/io/textscan.m, scripts/linear-algebra/expm.m,
scripts/miscellaneous/edit.m, scripts/optimization/lsqnonneg.m,
scripts/optimization/pqpnonneg.m, scripts/pkg/private/dirempty.m,
scripts/plot/findobj.m, scripts/plot/graphics_toolkit.m,
scripts/plot/private/__errplot__.m, scripts/plot/private/__interp_cube__.m,
scripts/plot/private/__marching_cube__.m, scripts/plot/subplot.m,
scripts/polynomial/residue.m, scripts/sparse/sprandsym.m,
scripts/special-matrix/gallery.m, scripts/strings/strjoin.m:
Use semicolon after "return" statement in core m-files.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 21 Aug 2013 19:53:42 -0700 |
parents | 3cce6b4e0f7c |
children |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
12793
diff
changeset
|
1 ## Copyright (C) 2006-2012 Daniel Sebald |
6087 | 2 ## |
6440 | 3 ## This file is part of Octave. |
4 ## | |
6087 | 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. | |
6087 | 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/>. | |
6087 | 18 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8794
diff
changeset
|
19 ## -*- texinfo -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8794
diff
changeset
|
20 ## @deftypefn {Function File} {@var{version} =} __gnuplot_version__ () |
6895 | 21 ## Undocumented internal function. |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8794
diff
changeset
|
22 ## @end deftypefn |
6895 | 23 |
6087 | 24 ## Return the version of gnuplot we are using. Note that we do not |
25 ## attempt to handle the case of the user switching to different | |
26 ## versions of gnuplot during the same session. | |
27 | |
28 function version = __gnuplot_version__ () | |
29 | |
30 persistent __version__ = ""; | |
31 | |
32 if (isempty (__version__)) | |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
33 [status, output] = system (sprintf ('"%s" --version', gnuplot_binary ())); |
7714
83ea845cda36
Display a (hopefully) informative error message if gnuplot isn't found
sh@sh-laptop
parents:
7017
diff
changeset
|
34 if (status != 0) |
7716
9c15f385811c
__gnuplot_version__: use newline at end of message
John W. Eaton <jwe@octave.org>
parents:
7714
diff
changeset
|
35 ## This message ends in a newline so that the traceback messages |
9c15f385811c
__gnuplot_version__: use newline at end of message
John W. Eaton <jwe@octave.org>
parents:
7714
diff
changeset
|
36 ## are skipped and people might actually see the message, read it, |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
37 ## comprehend it, take the advice it gives, and stop asking us |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
38 ## why plotting fails when gnuplot is not found. |
7716
9c15f385811c
__gnuplot_version__: use newline at end of message
John W. Eaton <jwe@octave.org>
parents:
7714
diff
changeset
|
39 error ("you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the 'gnuplot_binary' function\n"); |
7714
83ea845cda36
Display a (hopefully) informative error message if gnuplot isn't found
sh@sh-laptop
parents:
7017
diff
changeset
|
40 endif |
8794
f16aafdd99ca
__gnuplot_version__.m: don't use regexp to extract version number
John W. Eaton <jwe@octave.org>
parents:
8163
diff
changeset
|
41 output = strrep (output, "gnuplot", ""); |
f16aafdd99ca
__gnuplot_version__.m: don't use regexp to extract version number
John W. Eaton <jwe@octave.org>
parents:
8163
diff
changeset
|
42 output = strrep (output, "patchlevel", "."); |
f16aafdd99ca
__gnuplot_version__.m: don't use regexp to extract version number
John W. Eaton <jwe@octave.org>
parents:
8163
diff
changeset
|
43 output = strrep (output, "\n", ""); |
f16aafdd99ca
__gnuplot_version__.m: don't use regexp to extract version number
John W. Eaton <jwe@octave.org>
parents:
8163
diff
changeset
|
44 output = strrep (output, "\r", ""); |
f16aafdd99ca
__gnuplot_version__.m: don't use regexp to extract version number
John W. Eaton <jwe@octave.org>
parents:
8163
diff
changeset
|
45 __version__ = strrep (output, " ", ""); |
6087 | 46 endif |
47 | |
48 version = __version__; | |
49 | |
50 endfunction | |
51 |