Mercurial > octave
changeset 25856:9578af67a0d4 stable
Document that image x/ydata indicate the centers of corner pixels (bug #54610).
* image.m, imagesc.m, imshow.m: Rephrase doc for x and y arguments to make it
clear that they indicate the coordinates of the center of pixels.
* genpropdoc.m: Ditto.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Fri, 07 Sep 2018 10:45:19 +0200 |
parents | 144820478378 |
children | c3c9c8533a86 |
files | doc/interpreter/genpropdoc.m scripts/image/image.m scripts/image/imagesc.m scripts/image/imshow.m |
diffstat | 4 files changed, 23 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/genpropdoc.m Thu Aug 30 10:03:09 2018 -0400 +++ b/doc/interpreter/genpropdoc.m Fri Sep 07 10:45:19 2018 +0200 @@ -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/scripts/image/image.m Thu Aug 30 10:03:09 2018 -0400 +++ b/scripts/image/image.m Fri Sep 07 10:45:19 2018 +0200 @@ -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 Thu Aug 30 10:03:09 2018 -0400 +++ b/scripts/image/imagesc.m Fri Sep 07 10:45:19 2018 +0200 @@ -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 Thu Aug 30 10:03:09 2018 -0400 +++ b/scripts/image/imshow.m Fri Sep 07 10:45:19 2018 +0200 @@ -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