ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 28 Apr 2018 06:04:21 +0200Display a graphics object with multiple primativeshttps://ask.sagemath.org/question/42106/display-a-graphics-object-with-multiple-primatives/ 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'Fri, 20 Apr 2018 22:02:29 +0200https://ask.sagemath.org/question/42106/display-a-graphics-object-with-multiple-primatives/Answer by Emmanuel Charpentier for <p>I'm trying to show how a set of lines changes with a matrix transformation. The part i am having trouble with is:</p>
<pre><code> g=Graphics()
for c in range(10):
g.add_primitive(parametric_plot(B*vector([x,c]) , (x, 0, 2*pi)))
show(g)
</code></pre>
<p>Because it doesn't plott the lines like i wanted but instead gives me</p>
<blockquote>
<p>'Graphics' object has no attribute 'options'</p>
</blockquote>
https://ask.sagemath.org/question/42106/display-a-graphics-object-with-multiple-primatives/?answer=42108#post-id-42108You 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,Sat, 21 Apr 2018 01:53:09 +0200https://ask.sagemath.org/question/42106/display-a-graphics-object-with-multiple-primatives/?answer=42108#post-id-42108Comment by ionsme for <p>You don't say what is $B$.</p>
<p>Assuming that $B$ is some 2x2 matrix, the followig WorksForMe(TM) :</p>
<pre><code>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
</code></pre>
<p>HTH,</p>
https://ask.sagemath.org/question/42106/display-a-graphics-object-with-multiple-primatives/?comment=42127#post-id-42127yes, B is a matrix, but why doesn't my code work?Mon, 23 Apr 2018 00:19:11 +0200https://ask.sagemath.org/question/42106/display-a-graphics-object-with-multiple-primatives/?comment=42127#post-id-42127Comment by Emmanuel Charpentier for <p>You don't say what is $B$.</p>
<p>Assuming that $B$ is some 2x2 matrix, the followig WorksForMe(TM) :</p>
<pre><code>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
</code></pre>
<p>HTH,</p>
https://ask.sagemath.org/question/42106/display-a-graphics-object-with-multiple-primatives/?comment=42197#post-id-42197> 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.Sat, 28 Apr 2018 06:04:21 +0200https://ask.sagemath.org/question/42106/display-a-graphics-object-with-multiple-primatives/?comment=42197#post-id-42197