Mercurial > hg > octave-lojdl
changeset 13980:bd2be36fd949
image.m: Warn if input coordinates are not linearly spaced.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Fri, 02 Dec 2011 20:33:42 -0500 |
parents | f35b593688a5 |
children | 5f8bc2f145f5 |
files | scripts/image/image.m |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/image/image.m +++ b/scripts/image/image.m @@ -95,6 +95,8 @@ ## Adapted-By: jwe function h = __img__ (x, y, img, varargin) + + persistent warn = true newplot (); @@ -113,6 +115,11 @@ xdata = [x(1), x(end)]; ydata = [y(1), y(end)]; + if ((numel (unique (diff (x))) > 1 || numel (unique (diff (y))) > 1) && warn) + warning ("Image does not map to non-linearly spaced coordinates") + warn = false; + endif + ca = gca (); tmp = __go_image__ (ca, "cdata", img, "xdata", xdata, "ydata", ydata,