Spherical points#

Tags: experimental

spherical points
/home/runner/work/docs/docs/.venv/lib/python3.12/site-packages/napari/_qt/qt_event_loop.py:50: UserWarning: System theme detection requires a Qt6 backend. Please switch to PyQt6 or PySide6 to use it.
  theme_type=get_system_theme(),

import numpy as np

import napari

np.random.seed()

pts = np.random.rand(100, 3) * 100
colors = np.random.rand(100, 3)
sizes = np.random.rand(100) * 20 + 10

viewer = napari.Viewer(ndisplay=3)
pts_layer = viewer.add_points(
    pts,
    face_color=colors,
    size=sizes,
    shading='spherical',
    border_width=0,
)

# antialiasing is currently a bit broken, this is especially bad in 3D so
# we turn it off here
pts_layer.antialiasing = 0

viewer.reset_view()

if __name__ == '__main__':
    napari.run()

Gallery generated by Sphinx-Gallery