# HG changeset patch # User David Bateman # Date 1224255992 -3600 # Node ID 7799d8c383124124123ea43b5a4468a14fff3125 # Parent 7eedf503ba1cf1cbce6deb753add8e04f216e8ab Small plotting fixes diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,11 @@ +2008-10-17 David Bateman + + * plot/__plt_get_axis_arg__.m: Exclude non-numeric and root figure + from potential axis handles. + * plot/colorbar.m: Remove debug output. + * plot/comet.m: Close plot before demo + * plot/contourc.m: No output if nargout == 0. + 2008-10-16 David Bateman * plot/subplot.m: Allow for column vector of children for figure. diff --git a/scripts/plot/__plt_get_axis_arg__.m b/scripts/plot/__plt_get_axis_arg__.m --- a/scripts/plot/__plt_get_axis_arg__.m +++ b/scripts/plot/__plt_get_axis_arg__.m @@ -32,8 +32,9 @@ ## Figure handles are integers, but object handles are non integer, ## therefore ignore integer scalars. - if (nargin > 1 && length (varargin) > 0 && numel(varargin{1}) == 1 - && ishandle (varargin{1}(1)) && ! isfigure (varargin{1}(1))) + if (nargin > 1 && length (varargin) > 0 && isnumeric (varargin{1}) + && numel (varargin{1}) == 1 && ishandle (varargin{1}(1)) + && varargin{1}(1) != 0 && ! isfigure (varargin{1}(1))) tmp = varargin{1}; obj = get (tmp); if (strcmp (obj.type, "axes") || strcmp (obj.type, "hggroup")) diff --git a/scripts/plot/colorbar.m b/scripts/plot/colorbar.m --- a/scripts/plot/colorbar.m +++ b/scripts/plot/colorbar.m @@ -236,7 +236,6 @@ endif if (! isnan (aspect)) - aspect set (cax, "dataaspectratio", aspect); endif endif diff --git a/scripts/plot/comet.m b/scripts/plot/comet.m --- a/scripts/plot/comet.m +++ b/scripts/plot/comet.m @@ -79,6 +79,7 @@ endfunction %!demo +%! close all; %! t = 0:.1:2*pi; %! x = cos(2*t).*(cos(t).^2); %! y = sin(2*t).*(sin(t).^2); diff --git a/scripts/plot/contourc.m b/scripts/plot/contourc.m --- a/scripts/plot/contourc.m +++ b/scripts/plot/contourc.m @@ -57,7 +57,7 @@ ## Author: Shai Ayal -function [c, lev] = contourc (varargin) +function [cout, lev] = contourc (varargin) if (nargin == 1) vn = 10; @@ -127,7 +127,8 @@ endwhile endif - if (nargout == 2) + if (nargout > 0) + cout = c; lev = vv; endif