Multilevel contour plots
1 view (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Rick Rosson
on 13 Jul 2011
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.
0 Comments
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!