|
"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
|