Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Logarithmic Surface Plot
Date: Mon, 17 Nov 2008 09:36:45 -0500
Organization: The MathWorks, Inc.
Lines: 41
Message-ID: <gfrvht$g18$1@fred.mathworks.com>
References: <gfjcc3$pvk$1@fred.mathworks.com> <c%gTk.7044$Oq2.5807@newsfe08.iad>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1226932605 16424 144.212.105.187 (17 Nov 2008 14:36:45 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 17 Nov 2008 14:36:45 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:501208



"Walter Roberson" <roberson@hushmail.com> wrote in message 
news:c%gTk.7044$Oq2.5807@newsfe08.iad...
> Alex Thiele wrote:
>> I am generating a 'Moving' Allan Variance script, and cannot figure out 
>> how to create
>> a logarithmic surface plot.
>
> Matlab will not do surfaces in with [XYZ]Scale set to 'log'

Sure it will, as long as the data in the appropriate dimension is positive.


[x, y, z] = peaks;

% All of x, y, and z contain negative values, so we need to translate them
minx = min(x(:));
miny = min(y(:));
minz = min(z(:));

% 2 is a semi-arbitrary "fudge factor", designed to make absolutely sure
% that none of the matrix elements even come close to 0
surf(x+abs(minx)+2, y+abs(miny)+2, z+abs(minz)+2);

% Set all three axes to be log scale
set(gca, 'XScale', 'log', 'YScale', 'log', 'ZScale', 'log')


I also tried changing the *Scale properties before SURFing, and as long as I 
added the commands:

view(3); hold on

to set the axes view to the 3d view and hold the *Scale property values 
before calling SURF, it worked.

-- 
Steve Lord
slord@mathworks.com