# HG changeset patch # User sh@sh-laptop # Date 1208369999 14400 # Node ID 83ea845cda36586912c35a704fc2727ca988d0dd # Parent 050f695c3a7807fa9b2430675aad26e983fc958a Display a (hopefully) informative error message if gnuplot isn't found diff -r 050f695c3a78 -r 83ea845cda36 scripts/ChangeLog --- a/scripts/ChangeLog Tue Apr 15 16:31:28 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 050f695c3a78 -r 83ea845cda36 scripts/plot/__gnuplot_version__.m --- a/scripts/plot/__gnuplot_version__.m Tue Apr 15 16:31:28 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}))