# HG changeset patch # User jwe # Date 1196816897 0 # Node ID be3280acbdb8a3f290f647e8f63cf1d0cf64db2a # Parent 3aa50748a3008cb56c503eaa8ed1e93b31e63d99 [project @ 2007-12-05 01:08:17 by jwe] diff --git a/doc/interpreter/plotimages.m b/doc/interpreter/plotimages.m --- 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 diff --git a/doc/interpreter/sparseimages.m b/doc/interpreter/sparseimages.m --- a/doc/interpreter/sparseimages.m +++ b/doc/interpreter/sparseimages.m @@ -37,9 +37,6 @@ endif 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"); @@ -60,6 +57,7 @@ sparse(ceil([1:n]/2),1:n,1,n,n); if (strcmp (nm, "gplot") || strcmp (nm, "grid")) fid = fopen (sprintf ("%s.txt", nm), "wt"); + fputs (fid, "\n"); fputs (fid, "+---------------------------------+\n"); fputs (fid, "| Image unavailable in text mode. |\n"); fputs (fid, "+---------------------------------+\n"); @@ -113,6 +111,7 @@ function printsparse(a,nm) fid = fopen (nm,"wt"); + fputs (fid, "\n"); for i = 1:size(a,1) if (rem(i,5) == 0) fprintf (fid," %2d - ", i); @@ -236,6 +235,7 @@ function sombreroimage (nm, typ) if (strcmp (typ, "txt")) fid = fopen (sprintf ("%s.txt", nm), "wt"); + fputs (fid, "\n"); fputs (fid, "+---------------------------------------+\n"); fputs (fid, "| Image unavailable because of a |\n"); fputs (fid, "| missing sparse matrix implementation. |\n");