Multiple surface plots on a single figure
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to make several figures with multiple surface plots on each. Not using subplot or anything, just a bunch of different-colored shells overlapping each other on one figure. What I've been trying to work with is:
for c = 1:figum
figure(c)
resolution = 50;
theta = linspace(1.7, 2.6, res);
phi = linspace(-.1, 0.8, res);
[theta, phi] = meshgrid(theta, phi);
hold on
for c = 1:10
%Calculate r values based on model parameters
[x, y, z] = sph2cart(theta, phi, r);
surf(x,y,z,(ones(size(x))*c))
end
hold off
legend('1','2','3','4','5','6','7','8','9','10')
end
But all I'm getting from this is Figure 1 with the tenth surface for the last figure, and then blank figure windows for the higher numbered figures in the loop. Any ideas why it seems to be skipping my hold on commands AND my new figure commands and just overwriting everything on the first figure?
Thanks in advance!
0 Commenti
Risposte (1)
Walter Roberson
il 30 Gen 2012
Perhaps you want figure(c) instead of figure(fignum), since fignum is a constant?
I also recommend you read my remarks in http://www.mathworks.com/matlabcentral/answers/22208-show-figure
Vedere anche
Categorie
Scopri di più su Graphics Performance in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!