Ask Your Question
1

Display a graphics object with multiple primatives

asked 2018-04-20 22:02:29 +0100

ionsme gravatar image

I'm trying to show how a set of lines changes with a matrix transformation. The part i am having trouble with is:

 g=Graphics()

 for c in range(10):

     g.add_primitive(parametric_plot(B*vector([x,c])  , (x, 0, 2*pi)))  

 show(g)

Because it doesn't plott the lines like i wanted but instead gives me

'Graphics' object has no attribute 'options'

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-04-21 01:53:09 +0100

Emmanuel Charpentier gravatar image

You don't say what is $B$.

Assuming that $B$ is some 2x2 matrix, the followig WorksForMe(TM) :

sage: g=Graphics()
sage: B=matrix([[1,2],[3,4]])
sage: for c in range(10):g+=parametric_plot(B*vector([x,c]),(x,0,2*pi))
sage: g.show()
Launched png viewer for Graphics object consisting of 10 graphics primitives

HTH,

edit flag offensive delete link more

Comments

yes, B is a matrix, but why doesn't my code work?

ionsme gravatar imageionsme ( 2018-04-23 00:19:11 +0100 )edit

yes, B is a matrix, but why doesn't my code work?

I am not sure that parametric_plot returns a graphic primitive... May be a bug.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2018-04-28 06:04:21 +0100 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-04-20 22:02:29 +0100

Seen: 274 times

Last updated: Apr 21 '18