Processing math: 100%
Ask Your Question
2

3D grid like the one in the picture

asked 10 years ago

boumol gravatar image

I am interested on drawing with Sage something like the following picture

image description

The code that appears in the picture uses Wolfram Language (and I got the picture from this link)

Moreover, what I am interested is to have some function that creates such a picture from a list of points (where by a point I refer to an element of Z3). Does anybody know how to do this with Sage?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
4

answered 10 years ago

MikeZabrocki gravatar image

sum(sphere(center=(i,j,k),size=1/2,color=(i/4,j/4,k/4)) for i in range(5) for j in range(5) for k in range(5))

Preview: (hide)
link

Comments

Thanks, it is exactly what I wanted. Do you know whether it is easy to write numbers (like a kind of labels) to each one of the balls (in such a way that we can later search for the ball with number 1, for the ball with number 2, etc)

boumol gravatar imageboumol ( 10 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: 10 years ago

Seen: 871 times

Last updated: Mar 25 '15