Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

Display a graphics object with multiple primatives

asked 7 years ago

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'

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 7 years ago

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,

Preview: (hide)
link

Comments

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

ionsme gravatar imageionsme ( 6 years ago )

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 ( 6 years ago )

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: 7 years ago

Seen: 323 times

Last updated: Apr 21 '18