Mercurial > hg > octave-nkf
comparison scripts/plot/__gnuplot_version__.m @ 11754:a7a4090cf532 release-3-0-x
__gnuplot_version__: use newline at end of message
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 16 Apr 2008 15:15:26 -0400 |
parents | 5cedea7a0fdd |
children | 7d6e659acc1a 7cc783e52ddb |
comparison
equal
deleted
inserted
replaced
11753:5cedea7a0fdd | 11754:a7a4090cf532 |
---|---|
27 persistent __version__ = ""; | 27 persistent __version__ = ""; |
28 | 28 |
29 if (isempty (__version__)) | 29 if (isempty (__version__)) |
30 [status, output] = system (sprintf ("%s --version", gnuplot_binary ())); | 30 [status, output] = system (sprintf ("%s --version", gnuplot_binary ())); |
31 if (status != 0) | 31 if (status != 0) |
32 error ("you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the 'gnuplot_binary' function"); | 32 ## This message ends in a newline so that the traceback messages |
33 ## are skipped and people might actually see the message, read it, | |
34 ## comprehend it, actually take the advice it gives, and stop | |
35 ## asking us why plotting fails when gnuplot is not found. | |
36 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"); | |
33 endif | 37 endif |
34 pattern = "^[^\\s]*\\s*([0-9]+\\.[0-9]+)\\s*[^\\s]*\\s*([^\\s]*)"; | 38 pattern = "^[^\\s]*\\s*([0-9]+\\.[0-9]+)\\s*[^\\s]*\\s*([^\\s]*)"; |
35 [d1, d2, d3, d4, matches] = regexp (output, pattern); | 39 [d1, d2, d3, d4, matches] = regexp (output, pattern); |
36 if (iscell (matches) && numel (matches) > 0 && iscellstr (matches{1})) | 40 if (iscell (matches) && numel (matches) > 0 && iscellstr (matches{1})) |
37 __version__ = matches{1}{1}; | 41 __version__ = matches{1}{1}; |