Skip to content

Instantly share code, notes, and snippets.

@sofroniewn
Created November 26, 2020 17:13
Show Gist options
  • Save sofroniewn/882d2ca67bcdb4b6c8993d1c6c04a320 to your computer and use it in GitHub Desktop.
Save sofroniewn/882d2ca67bcdb4b6c8993d1c6c04a320 to your computer and use it in GitHub Desktop.
"""
Display many points layers
"""
import numpy as np
import napari
from time import time
data = []
for i in range(50):
data.append(np.random.random((1000, 2)))
viewer = napari.components.ViewerModel()
for i, points in enumerate(data):
# add the points
start = time()
viewer.add_points(points)
end = time()
print(f'run {i} in time {end - start}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment