diff doc/interpreter/plotimages.m @ 7256:be3280acbdb8

[project @ 2007-12-05 01:08:17 by jwe]
author jwe
date Wed, 05 Dec 2007 01:08:17 +0000
parents e8d953d03f6a
children e8a3e3e33490
line wrap: on
line diff
--- a/doc/interpreter/plotimages.m
+++ b/doc/interpreter/plotimages.m
@@ -18,7 +18,9 @@
 
 function plotimages (nm, typ)
   bury_output ();
-  if (strcmp (nm, "plot"))
+  if (strcmp(typ , "txt"))
+    image_as_txt(nm);
+  elseif (strcmp (nm, "plot"))
     x = -10:0.1:10;
     plot (x, sin (x));
     print (strcat (nm, ".", typ), strcat ("-d", typ))    
@@ -63,10 +65,17 @@
   bury_output ();
 endfunction
 
-## Use this function before plotting commands and after every call to
-## print since print() resets output to stdout (unfortunately, gnpulot
-## can't pop output as it can the terminal type).
 function bury_output ()
   f = figure (1);
   set (f, "visible", "off");
 endfunction
+
+## generate something for the texinfo @image command to process
+function image_as_txt(nm)
+  fid = fopen (sprintf ("%s.txt", nm), "wt");
+  fputs (fid, "\n");
+  fputs (fid, "+---------------------------------+\n");
+  fputs (fid, "| Image unavailable in text mode. |\n");
+  fputs (fid, "+---------------------------------+\n");
+  fclose (fid);
+endfunction