Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: modify surf default behavior
Date: Thu, 4 Jun 2009 10:55:04 +0000 (UTC)
Organization: Magnitude
Lines: 33
Message-ID: <h08968$qu$1@fred.mathworks.com>
References: <h06cdq$b1h$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1244112904 862 172.30.248.35 (4 Jun 2009 10:55:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 4 Jun 2009 10:55:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 865475
Xref: news.mathworks.com comp.soft-sys.matlab:544762


"Alan B" <monguin61@yahoo.com> wrote in message <h06cdq$b1h$1@fred.mathworks.com>...
> I would like axis('vis3d') to be run automatically when surf is called, is this possible? I can think of two things to try:
> 1. create a new wrapper m-file, also called surf.m, that simply passes the arguments around, and calls axis('vis3d') when done. I don't know how to do this because surf is not a built-in command, so builtin() doesn't work - how can I run a specific shadowed m-file, instead of whichever MATLAB chooses as the default?
> 2. set some default axes properties. I don't know how to do this because I was unable to understand what axis('vis3d') actually does, in terms of axes aspect ratio properties. Also, is it possible to specify different default properties for 2D vs 3D plots?
> 
> Any help is appreciated.


1. Concerning shadowing a builtin

You can create your own surf.m function. Then by using addpath or pathtool, make the path of your own function to be the top of the path.
The command:
>>which -all surf
will show you that your own surf.m is shadowing the path $matlabroot\toolbox\matlab\graph3d\surf.msurf 

2. Concerning axis3d algorithm

2.1  Read Section "Specifying Aspect Ratio";
http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/f4-24991.html#f4-25109


2.2 You can also edit axis.m and read the lines:
% handle VIS3D:
            elseif(strcmp(cur_arg,'vis3d'))
                set(ax(j),...
                    'CameraViewAngle',   get(ax(j),'CameraViewAngle'),...
                    'DataAspectRatio',   get(ax(j),'DataAspectRatio'),...
                    'PlotBoxAspectRatio',get(ax(j),'PlotBoxAspectRatio'));
      

Hope it helps,

Aur?lien