File: scatter_large.py

package info (click to toggle)
vedo 2025.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,404 kB
  • sloc: python: 64,792; javascript: 1,932; xml: 437; sh: 139; makefile: 6
file content (20 lines) | stat: -rw-r--r-- 444 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Scatter plot of 1M points with
assigned colors and transparencies.

Use mouse to zoom,
press r to reset,
press p to increase point size."""
from vedo import *

N = 1000000

x = np.random.rand(N)
y = np.random.rand(N)
RGBA = np.c_[x*255, y*255, np.zeros(N), y*255]

pts = np.array([x,y]).T
pts = Points(pts).point_size(1)
pts.pointcolors = RGBA

# use mouse to zoom, press r to reset
show(pts, __doc__, axes=1, mode="RubberBandZoom").close()