Graphics

Sage

Documentation sur Graphics

Un objet Graphics une liste d'objets graphics (line, circle, plot, scatter_plot, ...).

sage: G = Graphics();

print G

Graphics object consisting of 0 graphics primitives

sage: c = circle((1,1), 1)

sage: G+=c; print G

Graphics object consisting of 1 graphics primitive

pour afficher ces triangles :

sage: h=10; c=0.4; p=0.5;

sage: G = Graphics()

sage: for x in srange(1,h+1):

l = [[0,x*sqrt(3)],[-x/2,-x*sqrt(3)/2],[x/2,-x*sqrt(3)/2],[0,x*sqrt(3)]]

...

G+=line(l,color=hue(c + p*(x/h)))

sage: G.show(figsize=[5,5])

» Glossaire de Sage