axis return size

Ben Abbott bpabbott at mac.com
Fri Jul 3 20:37:44 CDT 2009


On Jul 3, 2009, at 9:36 AM, David Woodburn wrote:

> I modified axis to only return 4 elements if the current figure is 2D:
>
> function curr_axis = __axis__ (ca, ax, varargin)
>
>   if (nargin == 1)
>     if (nargout == 0)
>       set (ca, "xlimmode", "auto", "ylimmode", "auto", "zlimmode",  
> "auto");
>     else
>       xlim = get (ca, "xlim");
>       ylim = get (ca, "ylim");
>       [azimuth, elevation] = view();
>       if elevation == 90
>         curr_axis = [xlim, ylim];
>       else
>         zlim = get (ca, "zlim");
>         curr_axis = [xlim, ylim, zlim];
>       end
>     endif
>
> This matches Matlab's style.
>
> David Woodburn

David, you change looks correct to me.

I'd commit this change, but as my notebooks video card is dead and it  
is in for repair I won't be able to get this for a week or more.  
Perhaps someone else can commit this change in David's name?

Ben




More information about the Bug-octave mailing list