# HG changeset patch # User jwe # Date 849906779 0 # Node ID 58113987ee03ebad350758631d3ef96bebea37f2 # Parent 5e0c65023ba530dbcd7876db7b755c60e7d4464c [project @ 1996-12-06 21:12:29 by jwe] diff --git a/doc/interpreter/arith.texi b/doc/interpreter/arith.texi --- a/doc/interpreter/arith.texi +++ b/doc/interpreter/arith.texi @@ -479,6 +479,7 @@ @end deftypefn @deftypefn {Mapping Function} {} lgamma (@var{a}, @var{x}) +@deftypefnx {Mapping Function} {} gammaln (@var{a}, @var{x}) Returns the natural logarithm of the gamma function. @end deftypefn diff --git a/doc/interpreter/help.texi b/doc/interpreter/help.texi --- a/doc/interpreter/help.texi +++ b/doc/interpreter/help.texi @@ -35,6 +35,10 @@ browser to read the on-line version of the manual. @end deffn +The help command can give you information about operators, but not the +comma and semicolons that are used as command separators. To get help +for those, you must type @code{help comma} or @code{help semicolon}. + @defvr {Built-in Variable} INFO_FILE The variable @code{INFO_FILE} names the location of the Octave info file. The default value is @code{"@value{OCTAVEHOME}/info/octave.info"}. diff --git a/doc/interpreter/install.texi b/doc/interpreter/install.texi --- a/doc/interpreter/install.texi +++ b/doc/interpreter/install.texi @@ -211,11 +211,12 @@ @item There is a bug with the makeinfo program that is distributed with -texinfo-3.1 that causes the indices in Octave's on-line manual to be -generated incorrectly. If you need to recreate the on-line -documentation, you should get the makeinfo program that is distributed -with texinfo-3.1 and apply the patch for makeinfo that is distributed -with Octave. See the file MAKEINFO.PATCH for more details. +Texinfo (through version 3.9) that causes the indices in Octave's +on-line manual to be generated incorrectly. If you need to recreate the +on-line documentation, you should get the makeinfo program that is +distributed with texinfo-3.9 and apply the patch for makeinfo that is +distributed with Octave. See the file @file{MAKEINFO.PATCH} for more +details. @item Some of the Fortran subroutines may fail to compile with older versions diff --git a/doc/interpreter/octave.texi b/doc/interpreter/octave.texi --- a/doc/interpreter/octave.texi +++ b/doc/interpreter/octave.texi @@ -146,7 +146,6 @@ * Readline Index:: An index for readline commands. * Info Index:: An index for info commands. - --- The Detailed Node Listing --- A Brief Introduction to Octave @@ -266,6 +265,7 @@ * Two-Dimensional Plotting:: * Three-Dimensional Plotting:: +* Multiple Plots on One Page:: * Miscellaneous Plotting Functions:: Input and Output diff --git a/doc/interpreter/plot.texi b/doc/interpreter/plot.texi --- a/doc/interpreter/plot.texi +++ b/doc/interpreter/plot.texi @@ -17,6 +17,7 @@ @menu * Two-Dimensional Plotting:: * Three-Dimensional Plotting:: +* Multiple Plots on One Page:: * Miscellaneous Plotting Functions:: @end menu @@ -345,7 +346,7 @@ @var{rho}. @end deftypefn -@node Three-Dimensional Plotting, Miscellaneous Plotting Functions, Two-Dimensional Plotting, Plotting +@node Three-Dimensional Plotting, Multiple Plots on One Page, Two-Dimensional Plotting, Plotting @section Three-Dimensional Plotting @deffn {Command} gsplot @var{ranges} @var{expression} @var{using} @var{title} @var{style} @@ -436,6 +437,16 @@ @code{meshdom}. @end deftypefn +@deftypefn {Function File} {[@var{xx}, @var{yy}] =} meshgrid (@var{x}, @var{y}) +Given vectors of @var{x} and @var{y} coordinates, return two matrices +corresponding to the @var{x} and @var{y} coordinates of a mesh. The +rows of @var{xx} are copies of @var{x}, and the columns of @var{yy} are +copies of @var{y}. + +@code{[@var{xx}, @var{yy}] = meshgrid (@var{x})} is an abbreviation for +@code{[@var{xx}, @var{yy}] = meshgrid (@var{x}, @var{x})}. +@end deftypefn + @defvr {Built-in Variable} gnuplot_binary The name of the program invoked by the plot command. The default value is @code{"gnuplot"}. @xref{Installation}. @@ -457,7 +468,112 @@ configure got it wrong, or if you upgrade your gnuplot installation. @end defvr -@node Miscellaneous Plotting Functions, , Three-Dimensional Plotting, Plotting +@node Multiple Plots on One Page, Miscellaneous Plotting Functions, Three-Dimensional Plotting, Plotting +@section Multiple Plots on One Page + +The following functions all require a version of @code{gnuplot} that +supports the multiplot feature. + +@deftypefn {Function File} {} mplot (@var{x}, @var{y}) +@deftypefnx {Function File} {} mplot (@var{x}, @var{y}, @var{fmt}) +@deftypefnx {Function File} {} mplot (@var{x1}, @var{y1}, @var{x2}, @var{y2}) +This is a modified version of @code{plot()} to work with the multiplot +version of @code{gnuplot} to plot multiple plots per page. +This plot version automatically advances to the next subplot position +after each set of arguments are processed. + +See command @var{plot()} for the various options to this command +as this is just mulitplot version of the same command. +@end deftypefn + +@deftypefn {Function File} {} multiplot (@var{xn}, @var{yn}) +Sets and resets multiplot mode. + +If the arguments are non-zero, @code{multiplot} will set up multiplot +mode with @var{xn}, @var{yn} subplots along the @var{x} and @var{y} +axes. If both arguments are zero, @code{multiplot} closes multiplot +mode. +@end deftypefn + +@deftypefn {Function File} {} oneplot () +If in multiplot mode, switches to single plot mode. +@end deftypefn + +@deftypefn {Function File} {} subplot (@var{rows}, @var{cols}, @var{index}) +@deftypefnx {Function File} {} subplot (@var{rcn}) +Sets @code{gnuplot} in multiplot mode and plots in location +given by index (there are @var{cols} by @var{rows} subwindows). + +Input: + +@table @var +@item rows +Number of rows in subplot grid. + +@item columns +Number of columns in subplot grid. + +@item index +Index of subplot where to make the next plot. +@end table + +If only one argument is supplied, then it must be a three digit value +specifying the location in digits 1 (rows) and 2 (columns) and the plot +index in digit 3. + +The plot index runs row-wise. First all the columns in a row are filled +and then the next row is filled. + +For example, a plot with 4 by 2 grid will have plot indices running as +follows: + +@example +@group + +-------+-------+-------+-------+ + | | | | | + | 1 | 2 | 3 | 4 | + | | | | | + +-------+-------+-------+-------+ + | | | | | + | 5 | 6 | 7 | 8 | + | | | | | + +-------+-------+-------+-------+ +@end group +@end example +@end deftypefn + +@deftypefn {Function File} {} subwindow (@var{xn}, @var{yn}) +Sets the subwindow position in multiplot mode for the next plot. The +multiplot mode has to be previously initialized using the +@code{multiplot()} command, otherwise this command just becomes an alias +to @var{multiplot()} +@end deftypefn + +@deftypefn {Function File} {} top_title (@var{string}) +@deftypefnx {Function File} {} bottom_title (@var{string}) +Makes a title with text @var{string} at the top (bottom) of the plot. +@end deftypefn + +@deftypefn {Function File} {} plot_border (...) +Multiple arguments allowed to specify the sides on which the border +is shown. Allowed arguments include: + +@example +@group + "blank", "BLANK", "b", "B", @result{} No borders displayed + "all", "ALL", "a", "A", @result{} All borders displayed + "north", "NORTH", "n", "N", @result{} North Border + "south", "SOUTH", "s", "S", @result{} South Border + "east", "EAST", "e", "E", @result{} East Border + "west", "WEST", "w", "W", @result{} West Border +@end group +@end example + +@noindent +Without any arguments, turns borders off. +@end deftypefn + +@node Miscellaneous Plotting Functions, , Multiple Plots on One Page, Plotting @section Miscellaneous Plotting Functions @deftypefn {Function File} {} bar (@var{x}, @var{y}) @@ -521,7 +637,8 @@ @deftypefn {Function File} {} xlabel (@var{string}) @deftypefnx {Function File} {} ylabel (@var{string}) -Specify x and y axis labels for the plot. If you already have a plot +@deftypefnx {Function File} {} zlabel (@var{string}) +Specify x, y, and z axis labels for the plot. If you already have a plot displayed, use the command @code{replot} to redisplay it with the new labels. @end deftypefn diff --git a/doc/interpreter/strings.texi b/doc/interpreter/strings.texi --- a/doc/interpreter/strings.texi +++ b/doc/interpreter/strings.texi @@ -174,6 +174,10 @@ @end example @end deftypefn +@deftypefn {Function File} {} str2num (@var{s}) +Convert the string @var{s} to a number. +@end deftypefn + @deftypefn {Function File} {} str2mat (@var{s_1}, @dots{}, @var{s_n}) Returns a matrix containing the strings @var{s_1}, @dots{}, @var{s_n} as its rows. Each string is padded with blanks in order to form a valid diff --git a/liboctave/Array2-idx.h b/liboctave/Array2-idx.h --- a/liboctave/Array2-idx.h +++ b/liboctave/Array2-idx.h @@ -365,10 +365,10 @@ int idx_j_is_colon = idx_j.is_colon (); if (idx_i_is_colon) - n = rhs_nr; + n = lhs_nr; if (idx_j_is_colon) - m = rhs_nc; + m = lhs_nc; if (idx_i && idx_j) { @@ -389,19 +389,7 @@ lhs.resize (new_nr, new_nc, 0.0); } - if (n == rhs_nr && m == rhs_nc) - { - for (int j = 0; j < m; j++) - { - int jj = idx_j.elem (j); - for (int i = 0; i < n; i++) - { - int ii = idx_i.elem (i); - lhs.elem (ii, jj) = rhs.elem (i, j); - } - } - } - else if (rhs_nr == 1 && rhs_nc == 1 && n > 0 && m > 0) + if (rhs_nr == 1 && rhs_nc == 1 && n > 0 && m > 0) { RT scalar = rhs.elem (0, 0); @@ -415,6 +403,18 @@ } } } + else if (n == rhs_nr && m == rhs_nc) + { + for (int j = 0; j < m; j++) + { + int jj = idx_j.elem (j); + for (int i = 0; i < n; i++) + { + int ii = idx_i.elem (i); + lhs.elem (ii, jj) = rhs.elem (i, j); + } + } + } else { (*current_liboctave_error_handler) diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +Fri Dec 6 14:41:15 1996 John W. Eaton + + * Array2-idx.h (assign): Test for rhs scalar case first. + If index is colon, set number of elements to lhs dimension, not + rhs dimension. + Thu Dec 5 13:05:18 1996 John W. Eaton * sun-utils.h: Don't declare MAIN_ or MAIN__ here.