# 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.

edit retag close merge delete

Sort by » oldest newest most voted

If 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.

more Try 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.)

more