diff scripts/plot/__gnuplot_version__.m @ 7714:83ea845cda36

Display a (hopefully) informative error message if gnuplot isn't found
author sh@sh-laptop
date Wed, 16 Apr 2008 14:19:59 -0400
parents a1dbe9d80eee
children 9c15f385811c
line wrap: on
line diff
--- 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}))