Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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)

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)