[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cylinder.m function - fixed copyright
From: |
Kai Habel |
Subject: |
Re: cylinder.m function - fixed copyright |
Date: |
Mon, 26 Nov 2007 21:18:25 +0100 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20070801) |
Kai Habel schrieb:
> John W. Eaton schrieb:
>
>> On 26-Nov-2007, Kai Habel wrote:
>>
>
>> Finally, I find it odd that
>>
>> [X, Y, Z] = cylinder(10:-1:0,50);
>>
>> by itself opens an empty plot window. I would expect it do only
>> compute the X, Y, and Z values, not display anything.
>>
>>
> This is because of the gca() call, I'll try to fix this.
>
> Kai
>
>
Here is patch which fixes the problem above and another bug.
Kai
ChangeLog:
2007-11-26 Kai Habel <address@hidden>
* plot/cylinder.m: Do not call gca, when only return values are
being requested. Set ax variable correctly.
--- cylinder.m.orig 2007-11-26 20:29:58.000000000 +0100
+++ cylinder.m 2007-11-26 20:36:06.000000000 +0100
@@ -47,16 +47,15 @@
nargs = nargin;
args = varargin;
+ ax = [];
- if (nargs > 1 && isscalar (varargin{1}) && ishandle (varargin{1}))
- if (! strcmp (get (varargin{1}, "type"), "axes"))
+ if (nargs > 0 && isscalar (args{1}) && ishandle (args{1}))
+ if (! strcmp (get (args{1}, "type"), "axes"))
error ("cylinder: expecting first argument to be an axes object");
endif
- ax = h;
+ ax = args{1};
nargs--;
args(1) = [];
- else
- ax = gca ();
endif
if (nargs == 0)
@@ -88,7 +87,9 @@
yy = y;
zz = z;
else
- axes(ax);
+ if !(isempty(ax))
+ axes(ax);
+ endif
surf (x, y, z);
endif