Mercurial > octave-nkf
comparison doc/interpreter/interpimages.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 | c3c1fb44f9b5 |
children | b439ccc9a162 |
comparison
equal
deleted
inserted
replaced
20350:b9d4ccf4291c | 20351:d8992a16643c |
---|---|
18 | 18 |
19 function interpimages (d, nm, typ) | 19 function interpimages (d, nm, typ) |
20 graphics_toolkit ("gnuplot"); | 20 graphics_toolkit ("gnuplot"); |
21 set_print_size (); | 21 set_print_size (); |
22 hide_output (); | 22 hide_output (); |
23 outfile = fullfile (d, strcat (nm, ".", typ)); | 23 outfile = fullfile (d, [nm "." typ]); |
24 if (strcmp (typ, "png")) | 24 if (strcmp (typ, "png")) |
25 set (0, "defaulttextfontname", "*"); | 25 set (0, "defaulttextfontname", "*"); |
26 endif | 26 endif |
27 if (strcmp (typ, "eps")) | 27 if (strcmp (typ, "eps")) |
28 d_typ = "-depsc2"; | 28 d_typ = "-depsc2"; |
89 | 89 |
90 ## Use this function before plotting commands and after every call to | 90 ## Use this function before plotting commands and after every call to |
91 ## print since print() resets output to stdout (unfortunately, gnpulot | 91 ## print since print() resets output to stdout (unfortunately, gnpulot |
92 ## can't pop output as it can the terminal type). | 92 ## can't pop output as it can the terminal type). |
93 function hide_output () | 93 function hide_output () |
94 f = figure (1); | 94 hf = figure (1); |
95 set (f, "visible", "off"); | 95 set (hf, "visible", "off"); |
96 endfunction | 96 endfunction |
97 | 97 |
98 ## generate something for the texinfo @image command to process | 98 ## generate something for the texinfo @image command to process |
99 function image_as_txt(d, nm) | 99 function image_as_txt (d, nm) |
100 fid = fopen (fullfile (d, strcat (nm, ".txt")), "wt"); | 100 fid = fopen (fullfile (d, [nm ".txt"]), "wt"); |
101 fputs (fid, "\n"); | 101 fputs (fid, "\n"); |
102 fputs (fid, "+---------------------------------+\n"); | 102 fputs (fid, "+---------------------------------+\n"); |
103 fputs (fid, "| Image unavailable in text mode. |\n"); | 103 fputs (fid, "| Image unavailable in text mode. |\n"); |
104 fputs (fid, "+---------------------------------+\n"); | 104 fputs (fid, "+---------------------------------+\n"); |
105 fclose (fid); | 105 fclose (fid); |