Ask Your Question
1

multiple parametric_plot's with for loop

asked 2012-05-21 06:47:33 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I'm studying differential geometry of curves and surfaces, and I have a question regarding multiple plots on one graphics, that is i want to plot multiple lines on one plot in for loop, but when I try to do that it shows only the last plot...

a,b,v,u = var('a b v u'); rectangular=(a,b,v);
z=0;
for i in range(81):
    z=i*pi/20;z
    pt=plot3d(z*v,(v,0,5),(a,0,5),(b,0,5),transformation=rectangular,plot_points=80,color="blue")
    show(pt)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-05-21 09:37:54 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

You have to 'add' the plots.
I guess you want do something like the following:

a,b,v,u = var('a b v u'); 
rectangular=(a,b,v); 
pt = Graphics()
for i in range(3): 
    z=i*pi/20
    pt += plot3d(z*v,(v,0,5),(a,0,5),(b,0,5),transformation=rectangular,plot_points=80,opacity=0.5) 
show(pt)

alternatively you can use list comprehension

plots = [ plot3d(i*pi/20*v,(v,0,5),(a,0,5),(b,0,5),transformation=rectangular,plot_points=80 ) for i in range(3) ]

show(sum(plots))
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-05-21 06:47:33 +0200

Seen: 659 times

Last updated: May 21 '12