Skip to content

Commit 93cf05f

Browse files
authored
Merge pull request #5904 from ales-erjavec/fixes/roc-ticks-index-error
[FIX] owrocanalysis: Fix an index error in custom tick calculation
2 parents 9c7d5fd + dc6ad19 commit 93cf05f

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Orange/widgets/evaluate/owrocanalysis.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -640,14 +640,18 @@ def enumticks(a):
640640
return None
641641
return [[(x, f"{x:.2f}") for x in a[::-1]]]
642642

643-
data = self.curve_data(self.target_index, self.selected_classifiers[0])
644-
points = data.merged.points
643+
axis_bottom = self.plot.getAxis("bottom")
644+
axis_left = self.plot.getAxis("left")
645645

646-
axis = self.plot.getAxis("bottom")
647-
axis.setTicks(enumticks(points.fpr))
648-
649-
axis = self.plot.getAxis("left")
650-
axis.setTicks(enumticks(points.tpr))
646+
if not self.selected_classifiers or len(self.selected_classifiers) > 1 \
647+
or self.roc_averaging != OWROCAnalysis.Merge:
648+
axis_bottom.setTicks(None)
649+
axis_left.setTicks(None)
650+
else:
651+
data = self.curve_data(self.target_index, self.selected_classifiers[0])
652+
points = data.merged.points
653+
axis_bottom.setTicks(enumticks(points.fpr))
654+
axis_left.setTicks(enumticks(points.tpr))
651655

652656
def _on_mouse_moved(self, pos):
653657
target = self.target_index

0 commit comments

Comments
 (0)