diff --git a/examples/run_imageviewer.py b/examples/run_imageviewer.py
index 6afe25efd5edc364897106162a29f0f2863f757e..40ccbdcf2561d3cd63968298acae7078bac3ea8d 100644
--- a/examples/run_imageviewer.py
+++ b/examples/run_imageviewer.py
@@ -14,12 +14,13 @@ server_info = {
 h5file = f"{aliby_output}{omero_name}/{position}.h5"
 iv = ImageViewer.remote(h5file, server_info, 2104)
 tpt_end = 10
+no_cells = 4
 # for information only
 iv.print_traps_with_cells(tpt_end)
 # use Napari to view cells
 # python -m pip install "napari[all]" --upgrade
 iv.view(
-    trap_ids=[4, 8, 13],
+    trap_ids=iv.sample_traps_with_cells(tpt_end=tpt_end, no_cells=no_cells),
     tpt_end=tpt_end,
     channels_to_skip=["cy5"],
     no_vertical_tiles=1,
diff --git a/src/wela/imageviewer.py b/src/wela/imageviewer.py
index b251a083c828720165ce577bb3dfb4e442e853c7..629d69ea4485a3bcf624a9f260549e2e0a750b6f 100644
--- a/src/wela/imageviewer.py
+++ b/src/wela/imageviewer.py
@@ -1,7 +1,14 @@
 from pathlib import Path
 
 import h5py
-import napari
+
+try:
+    import napari
+except ModuleNotFoundError:
+    print(
+        "Napari cannot be imported.\nRun",
+        ' python -m pip install "napari[all]"',
+    )
 import numpy as np
 from agora.io.cells import Cells
 from aliby.io.image import dispatch_image
@@ -62,7 +69,7 @@ class ImageViewer:
             iv.cells = Cells.from_source(iv.h5file_path)
             return iv
 
-    def print_traps_with_cells(self, tpt_end, tpt_start=0):
+    def get_all_traps_with_cells(self, tpt_end, tpt_start=0, display=True):
         """List traps with cells."""
         cells = self.cells
         tpts = range(tpt_start, tpt_end)
@@ -72,9 +79,23 @@ class ImageViewer:
                 if tpt in cells.nonempty_tp_in_trap(trap_id):
                     traps_with_cells.append(trap_id)
                     break
-        print(f"Traps with cells {traps_with_cells}")
+        if display:
+            print(f"Traps with cells {traps_with_cells}")
         return traps_with_cells
 
+    def sample_traps_with_cells(self, no_cells, tpt_end, tpt_start=0):
+        """Sample some traps that have cells."""
+        traps_with_cells = self.get_all_traps_with_cells(
+            tpt_end, tpt_start, display=False
+        )
+        rng = np.random.default_rng()
+        samples = rng.integers(
+            low=0,
+            high=len(traps_with_cells),
+            size=np.min([no_cells, len(traps_with_cells)]),
+        )
+        return samples
+
     def get_tiles(self, trap_id, tps, channels_to_skip=None, cell_only=True):
         """Get dict of tiles with channel indices as keys."""
         tiles_dict = {}
diff --git a/src/wela/plotting.py b/src/wela/plotting.py
index 5040d7e2ea7e2db853f6dda857cdb1b93a622da3..56a412e168ebf92e3c4cb2d2b2074e68d3d64e1a 100644
--- a/src/wela/plotting.py
+++ b/src/wela/plotting.py
@@ -496,7 +496,7 @@ def plot2Dhist(
     --------
     Load data:
     >>> from wela.dataloader import dataloader
-    >>> from wela.plotting import plothist
+    >>> from wela.plotting import plot2Dhist
     >>> dl = dataloader()
     >>> dl.load("1334_2023_03_28_pyrTo2Gal_01glc_00", use_tsv=True)
     >>> dlc = dataloader()
@@ -507,8 +507,8 @@ def plot2Dhist(
     >>> tc, dc = dlc.get_time_series("median_GFP")
 
     Plot both data sets using axes with the same range:
-    >>> bins = plothist(t, dc, title="2% Gal", figsize=(4, 3))[0]
-    >>> plothist(t, d, title="2% Gal and 0.1% Glu", bins=bins, figsize=(4, 3))
+    >>> bins = plot2Dhist(t, dc, title="2% Gal", figsize=(4, 3))[0]
+    >>> plot2Dhist(t, d, title="2% Gal and 0.1% Glu", bins=bins, figsize=(4, 3))
     """
     if x.ndim == 1:
         # make into a 2D array