octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automated (or otherwise) tests for graphics code?


From: David Bateman
Subject: Re: automated (or otherwise) tests for graphics code?
Date: Fri, 17 Oct 2008 16:08:52 +0100
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

David Bateman wrote:
John W. Eaton wrote:
We seem to be having a lot of regressions in the graphics code
lately, so maybe it is time to start thinking of some way to provide
tests for these functions.

Hey progress is making a different mistake -)

I applied the attached patch that fixes a few more of the plotting problems

D.



--
David Bateman                                address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob) 91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax) The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary

# HG changeset patch
# User David Bateman <address@hidden>
# Date 1224255992 -3600
# Node ID 6c85c245b7a7598a43301770ada9f26cff8fa8d4
# Parent  faf6463bc0904b9f3aa57f09313cafd9ed836b2b
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  <address@hidden>
+
+       * 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  <address@hidden>
 
        * 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 <address@hidden>
 
-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
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]