@@ -32,6 +32,8 @@ class UnitLocationsWidget(BaseWidget):
32
32
If True, the legend is plotted (matplotlib backend)
33
33
hide_axis : bool, default: False
34
34
If True, the axis is set to off (matplotlib backend)
35
+ margin : float, default: 50
36
+ Amount of margin to add to plot, beyond the extremum unit locations.
35
37
"""
36
38
37
39
def __init__ (
@@ -45,6 +47,7 @@ def __init__(
45
47
plot_legend : bool = False ,
46
48
hide_axis : bool = False ,
47
49
backend : str | None = None ,
50
+ margin : float = 50 ,
48
51
** backend_kwargs ,
49
52
):
50
53
sorting_analyzer = self .ensure_sorting_analyzer (sorting_analyzer )
@@ -59,12 +62,12 @@ def __init__(
59
62
x_locations = all_unit_locations [:, 0 ]
60
63
x_min = np .min (x_locations )
61
64
x_max = np .max (x_locations )
62
- x_lim = (x_min - 50 , x_max + 50 )
65
+ x_lim = (x_min - margin , x_max + margin )
63
66
64
67
y_locations = all_unit_locations [:, 1 ]
65
68
y_min = np .min (y_locations )
66
69
y_max = np .max (y_locations )
67
- y_lim = (y_min - 50 , y_max + 50 )
70
+ y_lim = (y_min - margin , y_max + margin )
68
71
69
72
sorting = sorting_analyzer .sorting
70
73
0 commit comments