octave-maintainers
[Top][All Lists]
Advanced

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

Re: meshz, and leading axis handles to mesh, meshc and surface


From: Kai Habel
Subject: Re: meshz, and leading axis handles to mesh, meshc and surface
Date: Thu, 29 Nov 2007 21:00:42 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20070801)

John W. Eaton schrieb:
> On 29-Nov-2007, David Bateman wrote:
>
> | What about something like the attached instead.. What is does is modify 
> | __plt_get_axis_handle__ such that is the first argument is logical is 
> | set a variable "nogca", that if this variable is true, then gca() will 
> | not be called. This allows the problematic functions to do something like
> | 
> | [h, varargin] = __plt_get_axis_handle__ ((nargout > 0), "sphere", 
> | varargin{:});
> | 
> | and then axes.m does not need to be modified.
>
> OK, that seems like a better solution.  I checked it in.
>
> Thanks,
>
> jwe
>
>   
I think a similar change is needed for shading.m. The attached patch
also adds the 'mark_as_command' line and fixes the following problem.

octave:3> surf(peaks)
octave:4> ax=gca
ax = -6
octave:5> shading(ax,"flat")
error: number of rows must match (1 != 0) near line 44, column 14
error: evaluating assignment expression near line 44, column 7
error: called from `shading' in file
`/home/kai/cvs-octave/octave/scripts/plot/shading.m'


Kai

ChangeLog:

2007-11-29  Kai Habel  <address@hidden>

  * plot/shading.m: Use __plt_get_axis_arg__ for optional axes argument,
  use mark_as_command.



--- shading.m.orig      2007-11-29 19:22:37.000000000 +0100
+++ shading.m   2007-11-29 20:54:49.000000000 +0100
@@ -27,21 +27,21 @@
 
 ## Author: Kai Habel <address@hidden>
 
-function shading (ax, mode)
+## PKG_ADD: mark_as_command shading
 
-  if (nargin == 1)
-    mode = ax;
-    ax = gca ();
-  endif
+function shading (varargin)
+
+  [ax, varargin] = __plt_get_axis_arg__ ("shading", varargin{:});
 
   if (nargin != 1 && nargin != 2)
     print_usage ();
   endif
 
+  mode = varargin{1};
   h1 = findobj (ax, "type", "patch");
   h2 = findobj (ax, "type", "surface");
 
-  obj = [h1, h2];
+  obj = [h1(:); h2(:)];
 
   for n = 1:numel(obj)
     h = obj(n); 

reply via email to

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