# HG changeset patch # User Ben Abbott # Date 1291379958 18000 # Node ID ffbcb0edfbdad83059b9c534cad2b058998a77b9 # Parent d800fc6bd067c3f1e36905354cafddb4849253f3 Fix handling of input array of length 2 in daspect.m and pbaspect.m diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-12-03 Konstantinos Poulios + + * plot/pbaspect.m, plot/daspect.m: Fix handling of input array of + length 2. + 2010-12-02 Ben Abbott * image/image.m: Only flip y-axis if nextplot property equal diff --git a/scripts/plot/daspect.m b/scripts/plot/daspect.m --- a/scripts/plot/daspect.m +++ b/scripts/plot/daspect.m @@ -63,8 +63,9 @@ case "auto" set (hax, "dataaspectratiomode", "auto"); endswitch - elseif (isreal (varargin{1}) - && any (numel (varargin{1}) == [2, 3])) + elseif (isreal (varargin{1}) && numel (varargin{1}) == 2) + set (hax, "dataaspectratio", [varargin{1}, 1]) + elseif (isreal (varargin{1}) && numel (varargin{1}) == 3) set (hax, "dataaspectratio", varargin{1}) else error ("daspect: invalid input.") diff --git a/scripts/plot/pbaspect.m b/scripts/plot/pbaspect.m --- a/scripts/plot/pbaspect.m +++ b/scripts/plot/pbaspect.m @@ -63,8 +63,9 @@ case "auto" set (hax, "plotboxaspectratiomode", "auto"); endswitch - elseif (isreal (varargin{1}) - && any (numel (varargin{1}) == [2, 3])) + elseif (isreal (varargin{1}) && numel (varargin{1}) == 2) + set (hax, "plotboxaspectratio", [varargin{1}, 1]) + elseif (isreal (varargin{1}) && numel (varargin{1}) == 3) set (hax, "plotboxaspectratio", varargin{1}) else error ("pbaspect: invalid input.")