# HG changeset patch # User sh@sh-laptop # Date 1208369999 14400 # Node ID 5cedea7a0fdd0cc19c5a6448cf660661431a9828 # Parent ee21531f1b5e8e7ea1e51bc267e252bf14bc4634 Display a (hopefully) informative error message if gnuplot isn't found diff -r ee21531f1b5e -r 5cedea7a0fdd scripts/ChangeLog --- a/scripts/ChangeLog Tue Apr 15 16:30:52 2008 -0400 +++ b/scripts/ChangeLog Wed Apr 16 14:19:59 2008 -0400 @@ -1,3 +1,7 @@ +2008-04-16 Soren Hauberg + + * plot/__gnuplot_version__.m: Display error if gnuplot is not found. + 2008-04-15 John W. Eaton * plot/view.m: Get values from current axes if nargin == 0. diff -r ee21531f1b5e -r 5cedea7a0fdd scripts/plot/__gnuplot_version__.m --- a/scripts/plot/__gnuplot_version__.m Tue Apr 15 16:30:52 2008 -0400 +++ b/scripts/plot/__gnuplot_version__.m Wed Apr 16 14:19:59 2008 -0400 @@ -28,6 +28,9 @@ if (isempty (__version__)) [status, output] = system (sprintf ("%s --version", gnuplot_binary ())); + if (status != 0) + error ("you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the 'gnuplot_binary' function"); + endif pattern = "^[^\\s]*\\s*([0-9]+\\.[0-9]+)\\s*[^\\s]*\\s*([^\\s]*)"; [d1, d2, d3, d4, matches] = regexp (output, pattern); if (iscell (matches) && numel (matches) > 0 && iscellstr (matches{1}))