scatter_large.py 444 B

1234567891011121314151617181920
  1. """Scatter plot of 1M points with
  2. assigned colors and transparencies.
  3. Use mouse to zoom,
  4. press r to reset,
  5. press p to increase point size."""
  6. from vedo import *
  7. N = 1000000
  8. x = np.random.rand(N)
  9. y = np.random.rand(N)
  10. RGBA = np.c_[x*255, y*255, np.zeros(N), y*255]
  11. pts = np.array([x,y]).T
  12. pts = Points(pts).point_size(1)
  13. pts.pointcolors = RGBA
  14. # use mouse to zoom, press r to reset
  15. show(pts, __doc__, axes=1, mode="RubberBandZoom").close()