Ask Your Question
2

What is meant by "graphics primitive" in the sage documentation?

asked 2018-10-28 01:35:38 +0200

Fubwubs gravatar image

I'm currently learning sage, and I keep seeing the phrase, "graphics primitive" mentioned in the manual, but I'm not quite sure what is meant by that. The closest thing I've found to a definition of it is on the page "Plotting Primitives" where it is defined as "things that know how to draw themselves in 2D". Does this just mean that a primitive is anything predefined by sage, like circles and lines? Also, are there only "graphics primitives" and not any other kind?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-10-28 23:25:23 +0200

slelievre gravatar image

In a sense, a graphics primitive is a component of a graphics object.

One way of creating a graphics object is to add several pre-existing ones.

In that case, you get a graphics object consisting of several graphics primitive.

Here is an example.

sage: a = plot(lambda x: 1)
sage: b = plot(lambda x: x)
sage: c = plot(lambda x: x^2)
sage: for g in (a, b, c, a + b, a + b + c):
....:     print g
....:
Graphics object consisting of 1 graphics primitive
Graphics object consisting of 1 graphics primitive
Graphics object consisting of 1 graphics primitive
Graphics object consisting of 2 graphics primitives
Graphics object consisting of 3 graphics primitives
edit flag offensive delete link more

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-10-28 01:35:38 +0200

Seen: 1,738 times

Last updated: Oct 28 '18