changeset 25861:fb775d5a626a

maint: merge stable to default.
author Rik <rik@octave.org>
date Fri, 07 Sep 2018 09:48:33 -0700
parents 5f22779e6857 (current diff) 60fd3c44769f (diff)
children e5a73a8c116c
files doc/interpreter/genpropdoc.m libinterp/corefcn/data.cc liboctave/util/oct-inttypes.h
diffstat 7 files changed, 89 insertions(+), 77 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/genpropdoc.m	Fri Sep 07 09:42:16 2018 -0700
+++ b/doc/interpreter/genpropdoc.m	Fri Sep 07 09:48:33 2018 -0700
@@ -1148,7 +1148,7 @@
 
       case "xdata"
         s.doc = "Two-element vector @code{[xmin xmax]} specifying the x \
-coordinates of the first and last columns of the image.\n\
+coordinates of the centers of the first and last columns of the image.\n\
 \n\
 Setting @code{xdata} to the empty matrix ([]) will restore the default value \
 of @code{[1 columns(image)]}.";
@@ -1156,7 +1156,7 @@
 
       case "ydata"
         s.doc = "Two-element vector @code{[ymin ymax]} specifying the y \
-coordinates of the first and last rows of the image.\n\
+coordinates of the centers of the first and last rows of the image.\n\
 \n\
 Setting @code{ydata} to the empty matrix ([]) will restore the default value \
 of @code{[1 rows(image)]}.";
--- a/doc/interpreter/plot.txi	Fri Sep 07 09:42:16 2018 -0700
+++ b/doc/interpreter/plot.txi	Fri Sep 07 09:48:33 2018 -0700
@@ -264,7 +264,10 @@
 
 The axis function may be used to change the axis limits of an existing
 plot and various other axis properties, such as the aspect ratio and the
-appearance of tic marks.
+appearance of tic marks.  By default, high level plotting functions such as
+@code{plot} reset axes properties.  Any customization of properties, for
+example by calling @code{axis}, @code{xlim}, etc., should happen after the plot
+is done or, alternatively, after calling the @ref{XREFhold, ,hold function}.
 
 @DOCSTRING(axis)
 
@@ -661,10 +664,11 @@
 @DOCSTRING(refresh)
 
 Normally, high-level plot functions like @code{plot} or @code{mesh} call
-@code{newplot} to initialize the state of the current axes so that the
-next plot is drawn in a blank window with default property settings.  To
-have two plots superimposed over one another, use the @code{hold}
-function.  For example,
+@code{newplot} to determine whether the state of the target axes should be
+initialized (the default) or if subsequent plots should be drawn on top of
+previous ones.  To have two plots drawn over one another, use the @code{hold}
+function or manually change the axes @ref{XREFaxesnextplot, ,nextplot}
+property.  For example,
 
 @example
 @group
@@ -1191,13 +1195,6 @@
 more specific test functions return true only if the argument is both a
 graphics handle and of the correct type (figure, axes, specified object type).
 
-The @code{whos} function can be used to show the object type of each currently
-defined graphics handle.  (Note: this is not true today, but it is, I hope,
-considered an error in whos.  It may be better to have whos just show
-graphics_handle as the class, and provide a new function which, given a
-graphics handle, returns its object type.  This could generalize the ishandle()
-functions and, in fact, replace them.)
-
 The @code{get} and @code{set} commands are used to obtain and set the values of
 properties of graphics objects.  In addition, the @code{get} command may be
 used to obtain property names.
@@ -1209,52 +1206,36 @@
 get (h, "type")
 @end example
 
-The properties and their current values are returned by @code{get (h)}
-where h is a handle of a graphics object.  If only the names of the
-allowed properties are wanted they may be displayed by:
-@code{get (h, "")}.
+The properties and their current values may be obtained in the form of a
+structure using @code{s = get (h)}, where @code{h} is the handle of a graphics
+object.  If only the names of the properties and the allowed values (for radio
+properties only) are wanted, one may use @code{set (h)}.
 
 Thus, for example:
 
-@smallexample
+@example
 h = figure ();
 get (h, "type")
-ans = figure
-get (h, "");
-error: get: ambiguous figure property name ; possible matches:
-
-__gl_extensions__      dockcontrols           renderer
-__gl_renderer__        doublebuffer           renderermode
-__gl_vendor__          filename               resize
-__gl_version__         graphicssmoothing      resizefcn
-__graphics_toolkit__   handlevisibility       selected
-__guidata__            hittest                selectionhighlight
-__modified__           integerhandle          selectiontype
-__mouse_mode__         interruptible          sizechangedfcn
-__myhandle__           inverthardcopy         tag
-__pan_mode__           keypressfcn            toolbar
-__plot_stream__        keyreleasefcn          type
-__rotate_mode__        menubar                uicontextmenu
-__zoom_mode__          mincolormap            units
-alphamap               name                   userdata
-beingdeleted           nextplot               visible
-busyaction             numbertitle            windowbuttondownfcn
-buttondownfcn          outerposition          windowbuttonmotionfcn
-children               paperorientation       windowbuttonupfcn
-clipping               paperposition          windowkeypressfcn
-closerequestfcn        paperpositionmode      windowkeyreleasefcn
-color                  papersize              windowscrollwheelfcn
-colormap               papertype              windowstyle
-createfcn              paperunits             wvisual
-currentaxes            parent                 wvisualmode
-currentcharacter       pointer                xdisplay
-currentobject          pointershapecdata      xvisual
-currentpoint           pointershapehotspot    xvisualmode
-deletefcn              position
-@end smallexample
-
-The properties of the root figure may be displayed by:
-@code{get (groot, "")}.
+@result{} ans = figure
+set (h)
+@result{}
+        alphamap:
+        beingdeleted:  [ @{off@} | on ]
+        busyaction:  [ cancel | @{queue@} ]
+        buttondownfcn:
+        clipping:  [ off | @{on@} ]
+        closerequestfcn:
+        color:
+        colormap:
+        createfcn:
+        currentaxes:
+        deletefcn:
+        dockcontrols:  [ @{off@} | on ]
+        filename:
+        graphicssmoothing:  [ off | @{on@} ]
+        handlevisibility:  [ callback | off | @{on@} ]
+        ...
+@end example
 
 The uses of @code{get} and @code{set} are further explained in
 @ref{XREFget,,get}, @ref{XREFset,,set}.
@@ -1739,6 +1720,25 @@
 object.  To quickly remove all user-defined defaults use the @code{reset}
 function.
 
+By default, high level plotting functions such as @code{plot} reset and
+redefine axes properties independently from the defaults.  An example of such
+property is the axes @code{box} property: it is set @code{on} by high level 2-D
+graphics functions regardless of the property @qcode{"defaultaxesbox"}.  Use
+the @code{hold} function to prevent this behavior:
+
+@example
+@group
+set (groot, "defaultaxesbox", "off");
+subplot (2, 1, 1);
+plot (1:10)
+title ("Box is on anyway")
+subplot (2, 1, 2);
+hold on
+plot (1:10)
+title ("Box is off")
+@end group
+@end example
+
 @DOCSTRING(reset)
 
 Getting the @qcode{"default"} property of an object returns a list of
@@ -2665,13 +2665,12 @@
 
 On Windows platforms, Octave uses software rendering for the OpenGL graphics
 toolkits (@qcode{"qt"} and @qcode{"fltk"}) by default.  This is done to avoid
-rendering and printing issues due to imperfect OpenGL driver implementations for
-diverse graphic cards from different vendors.  As a down-side, software
-rendering might be considerably slower than hardware accelerated rendering.  To
-permanently switch back to hardware accelerated rendering with your graphic card
-drivers, rename the following file while Octave is closed:
+rendering and printing issues due to imperfect OpenGL driver implementations
+for diverse graphic cards from different vendors.  As a down-side, software
+rendering might be considerably slower than hardware accelerated rendering. 
+To permanently switch back to hardware accelerated rendering with your graphic
+card drivers, rename the following file while Octave is closed:
 
 @file{@var{octave-home}\bin\opengl32.dll}
 @*where @var{octave-home} is the directory in which Octave is installed (the
 default is @file{C:\Octave\Octave-@var{version}}).
-
--- a/libinterp/corefcn/data.cc	Fri Sep 07 09:42:16 2018 -0700
+++ b/libinterp/corefcn/data.cc	Fri Sep 07 09:48:33 2018 -0700
@@ -904,8 +904,15 @@
 %!assert <*45587> (! signbit (mod (0, -0)))
 
 %!assert <*42627> (mod (0.94, 0.01), 0.0)
+
+%!assert <*54602> (mod (int8 (125), int8 (-25)), int8 (0))
+%!assert <*54602> (mod (int8 (-125), int8 (-25)), int8 (0))
+%!assert <*54602> (mod (int8 (-125), int8 (0)), int8 (-125))
+%!assert <*54602> (mod (int8 (0), int8 (-25)), int8 (0))
+
 */
 
+
 #define DATA_REDUCTION(FCN)                                             \
                                                                         \
   int nargin = args.length ();                                          \
--- a/liboctave/util/oct-inttypes.h	Fri Sep 07 09:42:16 2018 -0700
+++ b/liboctave/util/oct-inttypes.h	Fri Sep 07 09:48:33 2018 -0700
@@ -723,7 +723,7 @@
     if (y != 0)
       {
         T r = x % y;
-        return ((r < 0) != (y < 0)) ? r + y : r;
+        return (r == 0) ? 0 : (((r < 0) != (y < 0)) ? r + y : r);
       }
     else
       return x;
--- a/scripts/image/image.m	Fri Sep 07 09:42:16 2018 -0700
+++ b/scripts/image/image.m	Fri Sep 07 09:48:33 2018 -0700
@@ -27,11 +27,12 @@
 ## The elements of @var{img} are indices into the current colormap.
 ##
 ## @var{x} and @var{y} are optional 2-element vectors, @w{@code{[min, max]}},
-## which specify the range for the axis labels.  If a range is specified as
-## @w{@code{[max, min]}} then the image will be reversed along that axis.  For
-## convenience, @var{x} and @var{y} may be specified as N-element vectors
-## matching the length of the data in @var{img}.  However, only the first and
-## last elements will be used to determine the axis limits.
+## which specify the coordinates of the centers of the corner pixels.
+## If a range is specified as @w{@code{[max, min]}} then the image will be
+## reversed along that axis.  For convenience, @var{x} and @var{y} may be
+## specified as N-element vectors matching the length of the data in @var{img}.
+## However, only the first and last elements will be used to determine the axis
+## limits.
 ##
 ## Multiple property/value pairs may be specified for the image object, but
 ## they must appear in pairs.
--- a/scripts/image/imagesc.m	Fri Sep 07 09:42:16 2018 -0700
+++ b/scripts/image/imagesc.m	Fri Sep 07 09:48:33 2018 -0700
@@ -30,10 +30,13 @@
 ## colormap.  If @code{@var{climits} = [@var{lo}, @var{hi}]} is given, then
 ## that range is set to the @qcode{"clim"} of the current axes.
 ##
-## The axis values corresponding to the matrix elements are specified in
-## @var{x} and @var{y}, either as pairs giving the minimum and maximum
-## values for the respective axes, or as values for each row and column
-## of the matrix @var{img}.
+## @var{x} and @var{y} are optional 2-element vectors, @w{@code{[min, max]}},
+## which specify the coordinates of the centers of the corner pixels.
+## If a range is specified as @w{@code{[max, min]}} then the image will be
+## reversed along that axis.  For convenience, @var{x} and @var{y} may be
+## specified as N-element vectors matching the length of the data in @var{img}.
+## However, only the first and last elements will be used to determine the axis
+## limits.
 ##
 ## The optional return value @var{h} is a graphics handle to the image.
 ##
--- a/scripts/image/imshow.m	Fri Sep 07 09:42:16 2018 -0700
+++ b/scripts/image/imshow.m	Fri Sep 07 09:48:33 2018 -0700
@@ -48,15 +48,17 @@
 ## @var{value1} is the colormap to use when displaying an indexed image.
 ##
 ## @item @qcode{"xdata"}
-## If @var{value1} is a two element vector, it must contain horizontal axis
-## limits in the form [xmin xmax]; Otherwise @var{value1} must be a vector and
-## only the first and last elements will be used for xmin and xmax
+## If @var{value1} is a 2-element vector, it must contain horizontal image
+## limits in the form [xmin, xmax], where xmin and xmax are the abscissa of
+## the centers of the corner pixels.  Otherwise @var{value1} must be a vector
+## and only the first and last elements will be used for xmin and xmax
 ## respectively.
 ##
 ## @item @qcode{"ydata"}
-## If @var{value1} is a two element vector, it must contain vertical axis
-## limits in the form [ymin ymax]; Otherwise @var{value1} must be a vector and
-## only the first and last elements will be used for ymin and ymax
+## If @var{value1} is a 2-element vector, it must contain vertical image
+## limits in the form [ymin, ymax], where ymin and ymax are the ordinates of
+## the center of the corner pixels.  Otherwise @var{value1} must be a vector
+## and only the first and last elements will be used for ymin and ymax
 ## respectively.
 ##
 ## @end table