@@ -21,7 +21,7 @@ def create_probe_collections(
2121 probe_shape_kwargs : dict = {},
2222):
2323 """Create PolyCollection objects for a Probe.
24-
24+
2525 Parameters
2626 ----------
2727 probe : Probe
@@ -36,7 +36,7 @@ def create_probe_collections(
3636 Dict with kwargs for contacts (e.g. alpha, edgecolor, lw)
3737 probe_shape_kwargs : dict, default: {}
3838 Dict with kwargs for probe shape (e.g. alpha, edgecolor, lw)
39-
39+
4040 Returns
4141 -------
4242 poly : PolyCollection
@@ -46,9 +46,11 @@ def create_probe_collections(
4646 """
4747 if probe .ndim == 2 :
4848 from matplotlib .collections import PolyCollection
49+
4950 Collection = PolyCollection
5051 elif probe .ndim == 3 :
5152 from mpl_toolkits .mplot3d .art3d import Poly3DCollection
53+
5254 Collection = Poly3DCollection
5355 else :
5456 raise ValueError (f"Unexpected probe.ndim: { probe .ndim } " )
@@ -70,7 +72,7 @@ def create_probe_collections(
7072
7173 vertices = probe .get_contact_vertices ()
7274 poly = Collection (vertices , color = contacts_colors , ** _contacts_kargs )
73-
75+
7476 if contacts_values is not None :
7577 poly .set_array (contacts_values )
7678 poly .set_cmap (cmap )
@@ -80,9 +82,10 @@ def create_probe_collections(
8082 planar_contour = probe .probe_planar_contour
8183 if planar_contour is not None :
8284 poly_contour = Collection ([planar_contour ], ** _probe_shape_kwargs )
83-
85+
8486 return poly , poly_contour
8587
88+
8689def plot_probe (
8790 probe ,
8891 ax = None ,
@@ -174,7 +177,7 @@ def plot_probe(
174177 ax .add_collection3d (poly )
175178 if poly_contour is not None :
176179 ax .add_collection3d (poly_contour )
177-
180+
178181 if show_channel_on_click :
179182 assert probe .ndim == 2 , "show_channel_on_click works only for ndim=2"
180183
0 commit comments