Ask Your Question

Display a graphics object with multiple primatives

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

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:


 for c in range(10):

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


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

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

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))
Launched png viewer for Graphics object consisting of 10 graphics primitives


edit flag offensive delete link more


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

ionsme gravatar imageionsme ( 2018-04-23 00:19:11 +0200 )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 +0200 )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


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

Seen: 235 times

Last updated: Apr 21 '18