ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 13 Dec 2018 11:41:23 -0600How to make points smaller than size 1 in point3d?http://ask.sagemath.org/question/44642/how-to-make-points-smaller-than-size-1-in-point3d/I am plotting a very large number of points in 3D, which I have in a list, using point3d. Below the same behavior is simulated for randomly generated points:
>point_list = []
>for n in range(10000):
>....point_list.append((random(), random(), random()))
> pic = point3d(point_list, color='red', size=1)
> pic.save(figsize=20)
I would like the points to be *very* small, since there are so many of them. It seems that "size" can only take positive integer values. As a workaround in point2d, you can make "figsize" much bigger, and the points stay the same size in pixels, which has the effect of scaling the point size down. But in point3d, when you make "figsize" bigger, you get the same picture, bigger. Could anyone help me make the points smaller?
Additionally, the default is for each point to be displayed as a little sphere, but I want it to be just a point. Again, in point2d, the code
> pic = point2d(point_list, color='black', size=1, marker='.' )
makes this happen, but when I do this in point3d they are still little spheres, and I cannot find any documentation about changing the marker for point3d.Tue, 11 Dec 2018 18:00:34 -0600http://ask.sagemath.org/question/44642/how-to-make-points-smaller-than-size-1-in-point3d/Answer by slelievre for <p>I am plotting a very large number of points in 3D, which I have in a list, using point3d. Below the same behavior is simulated for randomly generated points:</p>
<blockquote>
<p>point_list = []</p>
<p>for n in range(10000):</p>
<p>....point_list.append((random(), random(), random()))</p>
<p>pic = point3d(point_list, color='red', size=1)</p>
<p>pic.save(figsize=20)</p>
</blockquote>
<p>I would like the points to be <em>very</em> small, since there are so many of them. It seems that "size" can only take positive integer values. As a workaround in point2d, you can make "figsize" much bigger, and the points stay the same size in pixels, which has the effect of scaling the point size down. But in point3d, when you make "figsize" bigger, you get the same picture, bigger. Could anyone help me make the points smaller? </p>
<p>Additionally, the default is for each point to be displayed as a little sphere, but I want it to be just a point. Again, in point2d, the code </p>
<blockquote>
<p>pic = point2d(point_list, color='black', size=1, marker='.' ) </p>
</blockquote>
<p>makes this happen, but when I do this in point3d they are still little spheres, and I cannot find any documentation about changing the marker for point3d.</p>
http://ask.sagemath.org/question/44642/how-to-make-points-smaller-than-size-1-in-point3d/?answer=44661#post-id-44661If you're interested in a 2d view in the end, just choose some projection
direction, apply the projection to your points, and do a point2d;
or see if viewer='tachyon' will give something acceptable.
If you want a 3d view, given that point3d gives you spheres, you might
as well plot spheres yourself and choose the radius; hopefully you can
choose a smaller radius than the one given by point3d; or you could
explore what sage.plot.plot3d.shapes2.Point actually does and try to
hack some variation.
Thu, 13 Dec 2018 11:41:23 -0600http://ask.sagemath.org/question/44642/how-to-make-points-smaller-than-size-1-in-point3d/?answer=44661#post-id-44661Answer by rburing for <p>I am plotting a very large number of points in 3D, which I have in a list, using point3d. Below the same behavior is simulated for randomly generated points:</p>
<blockquote>
<p>point_list = []</p>
<p>for n in range(10000):</p>
<p>....point_list.append((random(), random(), random()))</p>
<p>pic = point3d(point_list, color='red', size=1)</p>
<p>pic.save(figsize=20)</p>
</blockquote>
<p>I would like the points to be <em>very</em> small, since there are so many of them. It seems that "size" can only take positive integer values. As a workaround in point2d, you can make "figsize" much bigger, and the points stay the same size in pixels, which has the effect of scaling the point size down. But in point3d, when you make "figsize" bigger, you get the same picture, bigger. Could anyone help me make the points smaller? </p>
<p>Additionally, the default is for each point to be displayed as a little sphere, but I want it to be just a point. Again, in point2d, the code </p>
<blockquote>
<p>pic = point2d(point_list, color='black', size=1, marker='.' ) </p>
</blockquote>
<p>makes this happen, but when I do this in point3d they are still little spheres, and I cannot find any documentation about changing the marker for point3d.</p>
http://ask.sagemath.org/question/44642/how-to-make-points-smaller-than-size-1-in-point3d/?answer=44658#post-id-44658Try a different viewer such as Tachyon. For interactive use:
pic.show(figsize=20, viewer='tachyon')
and for saving to a file:
pic.save(figsize=20, viewer='tachyon')
This viewer accepts floating-point `point3d` sizes such as `0.5`.
(The Jmol viewer truncates to integer sizes, as you noticed.)Thu, 13 Dec 2018 10:34:34 -0600http://ask.sagemath.org/question/44642/how-to-make-points-smaller-than-size-1-in-point3d/?answer=44658#post-id-44658