Skip to content

Commit

Permalink
gt study widget xlim
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgarcia committed Sep 19, 2023
1 parent 469b520 commit d7aaa95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/spikeinterface/widgets/gtstudy.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,14 @@ def plot_matplotlib(self, data_plot, **backend_kwargs):
study = dp.study
perfs = study.get_performance_by_unit(case_keys=dp.case_keys)

max_metric = 0
for key in dp.case_keys:
x = study.get_metrics(key)[dp.metric_name].values
y = perfs.xs(key)[dp.performance_name].values
label = dp.study.cases[key]["label"]
self.ax.scatter(x, y, label=label)
max_metric = max(max_metric, np.max(x))

self.ax.legend()
self.ax.legend()
self.ax.set_xlim(0, max_metric * 1.05)
self.ax.set_ylim(0, 1.05)

0 comments on commit d7aaa95

Please sign in to comment.