First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 12 years ago

calc314 gravatar image

You'll also need to use Graphics() prior to your for loop to define p1 and p2 to be graphics objects. (As an option, you could use the += assignment to shorten the code.)

t=var('t')
p1=Graphics()
p2=Graphics()
for i in range(-3,3,1):
    p1 +=parametric_plot((t,i),(t,-5,5),color="red")
    p2 +=parametric_plot((i,t),(t,-5,5),color="gray")
show(p1+p2)
click to hide/show revision 2
No.2 Revision

You'll also need to use Graphics() prior to your for loop to define p1 and p2 to be graphics objects. (As an option, you could use the += assignment to shorten the code.)

t=var('t')
p1=Graphics()
p2=Graphics()
for i in range(-3,3,1):
    p1 +=parametric_plot((t,i),(t,-5,5),color="red")
    p2 +=parametric_plot((i,t),(t,-5,5),color="gray")
show(p1+p2)