changeset 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 961410931a4f
children 0b08eaf77dd6
files doc/interpreter/geometry.txi doc/interpreter/interp.txi doc/interpreter/plot.txi doc/interpreter/plotimages.m doc/interpreter/sparse.txi
diffstat 5 files changed, 53 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/geometry.txi	Sat Apr 04 20:00:18 2009 +0200
+++ b/doc/interpreter/geometry.txi	Sat Apr 04 14:28:22 2009 -0700
@@ -82,7 +82,7 @@
 The result of which can be seen in @ref{fig:delaunay}.
 
 @float Figure,fig:delaunay
-@image{delaunay,8cm}
+@center @image{delaunay,4in}
 @caption{Delaunay triangulation of a random set of points}
 @end float
 @end ifnotinfo
@@ -124,7 +124,7 @@
 The output of the above can be seen in @ref{fig:triplot}.
 
 @float Figure,fig:triplot
-@image{triplot,8cm}
+@center @image{triplot,4in}
 @caption{Delaunay triangulation of a random set of points}
 @end float
 @end ifnotinfo
@@ -314,7 +314,7 @@
 diagram clearer.
 
 @float Figure,fig:voronoi
-@image{voronoi,8cm}
+@center @image{voronoi,4in}
 @caption{Delaunay triangulation and Voronoi diagram of a random set of points}
 @end float
 @end ifnotinfo
@@ -369,7 +369,7 @@
 The result of which can be seen in @ref{fig:inpolygon}.
 
 @float Figure,fig:inpolygon
-@image{inpolygon,8cm}
+@center @image{inpolygon,4in}
 @caption{Demonstration of the @code{inpolygon} function to determine the
 points inside a polygon}
 @end float
@@ -405,7 +405,7 @@
 The output of the above can be seen in @ref{fig:convhull}.
 
 @float Figure,fig:convhull
-@image{convhull,8cm}
+@center @image{convhull,4in}
 @caption{The convex hull of a simple set of points}
 @end float
 @end ifnotinfo
@@ -451,7 +451,7 @@
 The output of the above can be seen in @ref{fig:griddata}.
 
 @float Figure,fig:griddata
-@image{griddata,8cm}
+@center @image{griddata,4in}
 @caption{Interpolation from a scattered data to a regular grid}
 @end float
 @end ifnotinfo
--- a/doc/interpreter/interp.txi	Sat Apr 04 20:00:18 2009 +0200
+++ b/doc/interpreter/interp.txi	Sat Apr 04 14:28:22 2009 -0700
@@ -70,13 +70,13 @@
 @ref{fig:interpderiv2}.
 
 @float Figure,fig:interpderiv1
-@image{interpderiv1,8cm}
+@center @image{interpderiv1,4in}
 @caption{Comparison of 'pchip' and 'spline' interpolation methods for a 
 step function}
 @end float
 
 @float Figure,fig:interpderiv2
-@image{interpderiv2,8cm}
+@center @image{interpderiv2,4in}
 @caption{Comparison of the second derivative of the 'pchip' and 'spline' 
 interpolation methods for a step function}
 @end float
@@ -121,7 +121,7 @@
 which demonstrates the poor behavior of Fourier interpolation for non-periodic functions, as can be seen in @ref{fig:interpft}.
 
 @float Figure,fig:interpft
-@image{interpft,8cm}
+@center @image{interpft,4in}
 @caption{Comparison of @code{interp1} and @code{interpft} for non-periodic data}
 @end float
 @end ifnotinfo
@@ -182,7 +182,7 @@
 The result of this code can be seen in @ref{fig:interpn}.
 
 @float Figure,fig:interpn
-@image{interpn,8cm}
+@center @image{interpn,4in}
 @caption{Demonstration of the use of @code{interpn}}
 @end float
 @end ifnotinfo
--- a/doc/interpreter/plot.txi	Sat Apr 04 20:00:18 2009 +0200
+++ b/doc/interpreter/plot.txi	Sat Apr 04 14:28:22 2009 -0700
@@ -64,7 +64,7 @@
 command will open a separate plot window to display the graph.
 
 @float Figure,fig:plot
-@image{plot,8cm}
+@center @image{plot,4in}
 @caption{Simple Two-Dimensional Plot.}
 @end float
 
@@ -99,7 +99,7 @@
 shown in @ref{fig:hist}.
 
 @float Figure,fig:hist
-@image{hist,8cm}
+@center @image{hist,4in}
 @caption{Histogram.}
 @end float
 
@@ -141,18 +141,20 @@
 example,
 
 @example
+@group
 x = 0:0.1:10;
 y = sin (x);
 yp =  0.1 .* randn (size (x));
 ym = -0.1 .* randn (size (x));
 errorbar (x, sin (x), ym, yp);
+@end group
 @end example
 
 @noindent
 produces the figure shown in @ref{fig:errorbar}.
 
 @float Figure,fig:errorbar
-@image{errorbar,8cm}
+@center @image{errorbar,4in}
 @caption{Errorbar plot.}
 @end float
 
@@ -176,7 +178,7 @@
 produces the spiral plot shown in @ref{fig:polar}.
 
 @float Figure,fig:polar
-@image{polar,8cm}
+@center @image{polar,4in}
 @caption{Polar plot.}
 @end float
 
@@ -276,7 +278,7 @@
 is similar to @code{meshgrid}, but works for N-dimensional matrices.
 
 @float Figure,fig:mesh
-@image{mesh,8cm}
+@center @image{mesh,4in}
 @caption{Mesh plot.}
 @end float
 
@@ -299,7 +301,7 @@
 displays the spiral in three dimensions shown in @ref{fig:plot3}.
 
 @float Figure,fig:plot3
-@image{plot3,8cm}
+@center @image{plot3,4in}
 @caption{Three dimensional spiral.}
 @end float
 
@@ -442,10 +444,12 @@
 For example
 
 @example
+@group
 figure (1);
 fplot (@@sin, [-10, 10]);
 figure (2);
 fplot (@@cos, [-10, 10]);
+@end group
 @end example
 
 @noindent
@@ -801,19 +805,19 @@
 
 @item key
 Either @code{"on"} or @code{"off"} to toggle display of the legend.
-Note that this property is not compatible with @sc{Matlab} and may be
+Note that this property is not compatible with @sc{matlab} and may be
 removed in a future version of Octave.
 
 @item keybox
 Either @code{"on"} or @code{"off"} to toggle display of a box around the
-legend.  Note that this property is not compatible with @sc{Matlab} and
+legend.  Note that this property is not compatible with @sc{matlab} and
 may be removed in a future version of Octave.
 
 @item keypos
 An integer from 1 to 4 specifying the position of the legend.  1
 indicates upper right corner, 2 indicates upper left, 3 indicates lower
 left, and 4 indicates lower right.  Note that this property is not
-compatible with @sc{Matlab} and may be removed in a future version of
+compatible with @sc{matlab} and may be removed in a future version of
 Octave.
 
 @item dataaspectratio
@@ -949,7 +953,7 @@
 
 @item keylabel
 The text of the legend entry corresponding to this line.  Note that this
-property is not compatible with @sc{Matlab} and may be removed in a
+property is not compatible with @sc{matlab} and may be removed in a
 future version of Octave.
 @end table
 
@@ -1232,7 +1236,7 @@
 The result of which can be seen in @ref{fig:extendedtext}
 
 @float Figure,fig:extendedtext
-@image{extended,8cm}
+@center @image{extended,4in}
 @caption{Example of inclusion of text with the @sc{TeX} interpreter}
 @end float
 @end ifnotinfo
@@ -1299,7 +1303,7 @@
 
 @item keylabel
 The text of the legend entry corresponding to this surface.  Note that
-this property is not compatible with @sc{Matlab} and may be removed in a
+this property is not compatible with @sc{matlab} and may be removed in a
 future version of Octave.
 @end table
 
@@ -1492,11 +1496,13 @@
 be passed after the 2 default arguments.  For example
 
 @example
+@group
 plot (x, "DeleteFcn", @{@@mycallback, "1"@})
 @dots{}
 function mycallback (src, data, a1)
   fprintf ("Closing plot %d\n", a1);
 endfunction
+@end group
 @end example
 
 The basic callback functions that are available for all graphics objects
--- 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
--- a/doc/interpreter/sparse.txi	Sat Apr 04 20:00:18 2009 +0200
+++ b/doc/interpreter/sparse.txi	Sat Apr 04 14:28:22 2009 -0700
@@ -382,7 +382,7 @@
 @dfn{treeplot}, @dfn{etreeplot} and @dfn{gplot} commands.
 
 @float Figure,fig:spmatrix
-@image{spmatrix,8cm}
+@center @image{spmatrix,4in}
 @caption{Structure of simple sparse matrix.}
 @end float
 
@@ -413,7 +413,7 @@
 @xref{fig:gplot}.
 
 @float Figure,fig:gplot
-@image{gplot,8cm}
+@center @image{gplot,4in}
 @caption{Simple use of the @dfn{gplot} command.}
 @end float
 @end ifset
@@ -502,7 +502,7 @@
 @end table
 
 In addition all of the standard Octave mapper functions (i.e., basic
-math functions that take a single argument) such as @dfn{abs}, etc
+math functions that take a single argument) such as @dfn{abs}, etc.
 can accept sparse matrices.  The reader is referred to the documentation
 supplied with these functions within Octave itself for further
 details.
@@ -650,7 +650,7 @@
 positive definite matrix.
 
 @float Figure,fig:simplematrix
-@image{spmatrix,8cm}
+@center @image{spmatrix,4in}
 @caption{Structure of simple sparse matrix.}
 @end float
 
@@ -708,12 +708,12 @@
 @ifset HAVE_CHOLMOD
 @ifset HAVE_COLAMD
 @float Figure,fig:simplechol
-@image{spchol,8cm}
+@center @image{spchol,4in}
 @caption{Structure of the un-permuted Cholesky factorization of the above matrix.}
 @end float
 
 @float Figure,fig:simplecholperm
-@image{spcholperm,8cm}
+@center @image{spcholperm,4in}
 @caption{Structure of the permuted Cholesky factorization of the above matrix.}
 @end float
 @end ifset
@@ -771,19 +771,19 @@
 
 @enumerate
 @item If the matrix is hermitian, with a positive real diagonal, attempt
-      Cholesky factorization using @sc{Lapack} xPTSV.
+      Cholesky factorization using @sc{lapack} xPTSV.
 
 @item If the above failed or the matrix is not hermitian with a positive
       real diagonal use Gaussian elimination with pivoting using 
-      @sc{Lapack} xGTSV, and goto 8.
+      @sc{lapack} xGTSV, and goto 8.
 @end enumerate
 
 @item If the matrix is hermitian with a positive real diagonal, attempt
-      Cholesky factorization using @sc{Lapack} xPBTRF.
+      Cholesky factorization using @sc{lapack} xPBTRF.
 
 @item if the above failed or the matrix is not hermitian with a positive
       real diagonal use Gaussian elimination with pivoting using 
-      @sc{Lapack} xGBTRF, and goto 8.
+      @sc{lapack} xGBTRF, and goto 8.
 @end enumerate
 
 @item If the matrix is upper or lower triangular perform a sparse forward
@@ -827,7 +827,7 @@
 calculating the condition number is significant, and can in fact
 exceed the cost of factoring the matrix.  Therefore the condition
 number is not calculated in these cases, and Octave relies on simpler
-techniques to detect singular matrices or the underlying LAPACK code in
+techniques to detect singular matrices or the underlying @sc{lapack} code in
 the case of banded matrices.
 
 The user can force the type of the matrix with the @code{matrix_type}
@@ -1150,7 +1150,7 @@
 @ifset HAVE_UMFPACK
 @ifset HAVE_COLAMD
 @float Figure,fig:femmodel
-@image{grid,8cm}
+@center @image{grid,4in}
 @caption{Example finite element model the showing triangular elements. 
 The height of each vertex corresponds to the solution value.}
 @end float