diff doc/interpreter/plotimages.m @ 9088:77e71f3da3d6

Fix documentation image printing under new development code Printed images are now clipped to image size rather than to papersize of 8.5x11 Images are scaled to 4 inches and centered in display pdf printing is sub-optimal as texi2pdf picks the png rendering (bitmap) rather than the pdf rendering (vector).
author Rik <rdrider0-list@yahoo.com>
date Sat, 04 Apr 2009 14:28:22 -0700
parents eb63fbe60fab
children 16f53d29049f
line wrap: on
line diff
--- a/doc/interpreter/plotimages.m	Sat Apr 04 20:00:18 2009 +0200
+++ b/doc/interpreter/plotimages.m	Sat Apr 04 14:28:22 2009 -0700
@@ -17,7 +17,9 @@
 ## <http://www.gnu.org/licenses/>.
 
 function plotimages (nm, typ)
-  bury_output ();
+  set_print_size ();
+  hide_output ();
+
   if (strcmp (typ, "png"))
     set (0, "defaulttextfontname", "*");
   endif
@@ -65,10 +67,18 @@
   else
     error ("unrecognized plot requested");
   endif
-  bury_output ();
+  hide_output ();
 endfunction
 
-function bury_output ()
+function set_print_size ()
+  image_size = [5.0, 3.5]; # in inches, 16:9 format
+  border = 0;              # For postscript use 50/72
+  set (0, "defaultfigurepapertype", "<custom>");
+  set (0, "defaultfigurepapersize", image_size + 2*border);
+  set (0, "defaultfigurepaperposition", [border, border, image_size]);
+endfunction
+
+function hide_output ()
   f = figure (1);
   set (f, "visible", "off");
 endfunction