Slight glitch with subplot and 3D graphs.

1 view (last 30 days)
Adam Hicks
Adam Hicks on 30 Jul 2015
When I run this code:
t = 0:.01*pi:10*pi;
plot3(1.*cos(t), 1.*sin(t), .1.*t) xlabel('x'),ylabel('y'),zlabel('z'),title('Helix A'),grid subplot(1,3,1);
plot3(1.*cos(t), 1.*sin(t), .2.*t) xlabel('x'),ylabel('y'),zlabel('z'),title('Helix B'),grid subplot(1,3,2);
plot3(1.*cos(t), 1.*sin(t), -.1.*t) xlabel('x'),ylabel('y'),zlabel('z'),title('Helix C'),grid subplot(1,3,3);
The figure displays only two of the helices, B and C. However, if you run the script a second time, it successfully produces all three of the helices which is what I need. How can I fix this simply?

Answers (0)

Categories

Find more on Line 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!