Ask Your Question

How to make points smaller than size 1 in point3d?

asked 2018-12-12 01:00:34 +0200

diana.davis gravatar image

updated 2018-12-13 16:28:27 +0200

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)

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 flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-12-13 18:41:23 +0200

slelievre gravatar image

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.

edit flag offensive delete link more

answered 2018-12-13 17:34:34 +0200

rburing gravatar image

updated 2018-12-13 17:37:48 +0200

Try a different viewer such as Tachyon. For interactive use:, viewer='tachyon')

and for saving to a file:, viewer='tachyon')

This viewer accepts floating-point point3d sizes such as 0.5.

(The Jmol viewer truncates to integer sizes, as you noticed.)

edit flag offensive delete link more

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


Asked: 2018-12-12 01:00:34 +0200

Seen: 914 times

Last updated: Dec 13 '18