Mercurial > octave-nkf
diff doc/interpreter/plotimages.m @ 20351:d8992a16643c
doc: Clean up m-files which generate images for Manual.
* geometryimages.m, interpimages.m, plotimages.m, sparseimages.m,
splineimages.m: Use the same style throughout the mi-files.
Obey Octave coding conventions.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 09 Jul 2015 21:38:57 -0700 |
parents | b9d4ccf4291c |
children | fc3056b9fac0 |
line wrap: on
line diff
--- a/doc/interpreter/plotimages.m Tue Jul 07 21:25:31 2015 +0100 +++ b/doc/interpreter/plotimages.m Thu Jul 09 21:38:57 2015 -0700 @@ -20,7 +20,7 @@ graphics_toolkit ("qt"); set_print_size (); hide_output (); - outfile = fullfile (d, strcat (nm, ".", typ)); + outfile = fullfile (d, [nm "." typ]); if (strcmp (typ, "png")) set (0, "defaulttextfontname", "*"); endif @@ -30,7 +30,7 @@ d_typ = ["-d", typ]; endif - if (strcmp(typ , "txt")) + if (strcmp (typ , "txt")) image_as_txt (d, nm); elseif (strcmp (nm, "plot")) x = -10:0.1:10; @@ -78,7 +78,7 @@ t = 0:0.1:10*pi; r = linspace (0, 1, numel (t)); z = linspace (0, 1, numel (t)); - plot3 (r.*sin(t), r.*cos(t), z); + plot3 (r.*sin (t), r.*cos (t), z); xlabel ("r.*sin (t)"); ylabel ("r.*cos (t)"); zlabel ("z"); @@ -126,16 +126,17 @@ ## print since print() resets output to stdout (unfortunately, gnuplot ## can't pop output as it can the terminal type). function hide_output () - f = figure (1); - set (f, "visible", "off"); + hf = figure (1); + set (hf, "visible", "off"); endfunction ## generate something for the texinfo @image command to process function image_as_txt (d, nm) - fid = fopen (fullfile (d, strcat (nm, ".txt")), "wt"); + fid = fopen (fullfile (d, [nm ".txt"]), "wt"); fputs (fid, "\n"); fputs (fid, "+---------------------------------+\n"); fputs (fid, "| Image unavailable in text mode. |\n"); fputs (fid, "+---------------------------------+\n"); fclose (fid); endfunction +