% Draw a line in a 3D space title('Demo of plot3'); z = linspace(-4*pi,4*pi,100); hold on h1=plot3(cos(z),sin(z),z,'r'); h2=plot3(-cos(z),-sin(z),z,'b'); set([h1 h2],'LineWidth',3); axis([-4 4 -4 4 -13 13]); hold off set(gca,'CameraPosition',[0 40 3]);