Multilevel contour plots

3 次查看(过去 30 天)
Joe
Joe 2011-7-13
Basically what I want to do is:
I have created three sets of data and have contour plots for them. Now all I want to do is display them all, at the same time, at different Z locations. Imagine you know the contour of some value for three different floors of a building and you just want to display all of them at the same time with space between them.
I feel like this should be pretty simple but I am having trouble finding a solution.

回答(1 个)

Rick Rosson
Rick Rosson 2011-7-13
The following code shows how to create a contour plot at 3 different locations other than the Z=0 plane:
N = 20;
L = 3;
A = zeros(N,N,L);
for k = 1:L
A(:,:,k) = peaks(N);
h = surfc(A(:,:,k));
hold on;
set(h(1),'visible','off');
for i = 2:length(h);
newz = get(h(i),'Zdata') + 5*k;
set(h(i),'Zdata',newz)
end
end
For more information:
docsearch('"Changing the Offset of a Contour"');
HTH.

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by