diff doc/interpreter/splineimages.m @ 20307:c3c1fb44f9b5

eliminate recursive make invocations in doc directory tree * doc/module.mk: New file created from doc/Makefile.am, doc/doxyhtml/Makefile.am, doc/liboctave/Makefile, doc/interpreter/Makefile.am, and doc/refcard/Makefile. * configure.ac (AC_OUTPUT): Don't generate doc/Makefile, doc/doxyhtml/Makefile, or doc/interpreter/Makefile. * Makefile.am (.NOTPARALLEL, AUTHORS, BUGS, INSTALL.OCTAVE): Delete targets. * config-images.sh, find-docstring-files.sh, geometryimages.m, graphics_properties.mk, images.awk, interpimages.m, plotimages.m, sparseimages.m, splineimages.m: Adapt to Makefile changes. * octave.texi, liboctave.texi: Use unique version file names. * etc/module.mk: Ensure icons build directory is created. (etc/icons/octave-logo.ico): Fix file name. * examples/module.mk (examples_code_SRC): New variable. * doc/Makefile.am, doc/doxyhtml/Makefile.am, doc/liboctave/Makefile.am, doc/interpreter/Makefile.am, doc/refcard/Makefile: Delete.
author John W. Eaton <jwe@octave.org>
date Fri, 03 Jul 2015 19:33:19 -0400
parents 606b05352351
children d8992a16643c
line wrap: on
line diff
--- a/doc/interpreter/splineimages.m	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/splineimages.m	Fri Jul 03 19:33:19 2015 -0400
@@ -16,10 +16,11 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-function splineimages (nm, typ)
+function splineimages (d, nm, typ)
   graphics_toolkit ("gnuplot");
   set_print_size ();
   hide_output ();
+  outfile = fullfile (d, strcat (nm, ".", typ));
   if (strcmp (typ, "png"))
     set (0, "defaulttextfontname", "*");
   endif
@@ -30,7 +31,7 @@
   endif
 
   if (strcmp (typ, "txt"))
-    image_as_txt (nm);
+    image_as_txt (d, nm);
   elseif (strcmp (nm, "splinefit1")) ## Breaks and Pieces
     x = 2 * pi * rand (1, 200);
     y = sin (x) + sin (2 * x) + 0.2 * randn (size (x));
@@ -47,7 +48,7 @@
     axis tight;
     ylim ([-2.5 2.5]);
     legend ("data", "41 breaks, 40 pieces", "11 breaks, 10 pieces");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit2")) ## Spline orders
     ## Data (200 points)
     x = 2 * pi * rand (1, 200);
@@ -69,7 +70,7 @@
     axis tight;
     ylim ([-2.5 2.5]);
     legend ({"data", "order 0", "order 1", "order 2", "order 3", "order 4"});
-    print ([nm, "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit3"))
     ## Data (100 points)
     x = 2 * pi * [0, (rand (1, 98)), 1];
@@ -86,7 +87,7 @@
     axis tight;
     ylim ([-2 3]);
     legend ({"data", "no constraints", "periodic"});
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit4"))
     ## Data (200 points)
     x = 2 * pi * rand (1, 200);
@@ -109,7 +110,7 @@
     axis tight;
     ylim ([-1.5 1.5]);
     legend({"data", "clamped", "hinged periodic"});
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit5"))
     ## Truncated data
     x = [0,  1,  2,  4,  8, 16, 24, 40, 56, 72, 80] / 80;
@@ -130,7 +131,7 @@
     legend ({"data", "spline", "breaks"});
     axis tight;
     ylim ([0 0.1]);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit6"))
     ## Data
     x = linspace (0, 2*pi, 200);
@@ -153,7 +154,7 @@
              "robust, beta = 0.75", "no robust fitting"});
     axis tight;
     ylim ([-2 2]);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   endif
   hide_output ();
 endfunction
@@ -176,8 +177,8 @@
 endfunction
 
 ## generate something for the texinfo @image command to process
-function image_as_txt(nm)
-  fid = fopen (sprintf ("%s.txt", nm), "wt");
+function image_as_txt(d, nm)
+  fid = fopen (fullfile (d, strcat (nm, ".txt")), "wt");
   fputs (fid, "\n");
   fputs (fid, "+---------------------------------+\n");
   fputs (fid, "| Image unavailable in text mode. |\n");