Ask Your Question
2

3D grid like the one in the picture

asked 2015-03-25 12:27:02 +0100

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 $\mathbb{Z}^3$). Does anybody know how to do this with Sage?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2015-03-25 13:19:14 +0100

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))

edit flag offensive delete link more

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 ( 2015-03-25 15:13:49 +0100 )edit

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: 2015-03-25 12:27:02 +0100

Seen: 735 times

Last updated: Mar 25 '15