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.Wed, 25 Mar 2015 15:13:49 +01003D grid like the one in the picturehttps://ask.sagemath.org/question/26325/3d-grid-like-the-one-in-the-picture/ I am interested on drawing with Sage something like the following picture
![image description](https://pbs.twimg.com/media/B5o-dZMIQAIJezs.jpg)
The code that appears in the picture uses Wolfram Language (and I got the picture from this [link](http://blog.wolfram.com/2014/09/18/introducing-tweet-a-program/))
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?Wed, 25 Mar 2015 12:27:02 +0100https://ask.sagemath.org/question/26325/3d-grid-like-the-one-in-the-picture/Answer by MikeZabrocki for <p>I am interested on drawing with Sage something like the following picture</p>
<p><img alt="image description" src="https://pbs.twimg.com/media/B5o-dZMIQAIJezs.jpg"/></p>
<p>The code that appears in the picture uses Wolfram Language (and I got the picture from this <a href="http://blog.wolfram.com/2014/09/18/introducing-tweet-a-program/">link</a>)</p>
<p>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?</p>
https://ask.sagemath.org/question/26325/3d-grid-like-the-one-in-the-picture/?answer=26326#post-id-26326sum(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)) Wed, 25 Mar 2015 13:19:14 +0100https://ask.sagemath.org/question/26325/3d-grid-like-the-one-in-the-picture/?answer=26326#post-id-26326Comment by boumol for <p>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)) </p>
https://ask.sagemath.org/question/26325/3d-grid-like-the-one-in-the-picture/?comment=26327#post-id-26327Thanks, 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)Wed, 25 Mar 2015 15:13:49 +0100https://ask.sagemath.org/question/26325/3d-grid-like-the-one-in-the-picture/?comment=26327#post-id-26327