Commit 41422101 authored by Alex UNNERVIK's avatar Alex UNNERVIK

Adjusted the histogram scale of the x axis to automatically adjust for varying...

Adjusted the histogram scale of the x axis to automatically adjust for varying scales across dev & eval

Updated fixed index for histogram x-limit fix
parent 9fd76ffb
Pipeline #38923 failed with stage
in 9 minutes and 37 seconds
......@@ -957,6 +957,8 @@ class Hist(GridSubplot):
dev_neg, dev_pos, eval_neg, eval_pos, threshold = self._get_neg_pos_thres(
idx, input_scores, input_names
)
xmin = min(numpy.min(dev_neg[0]), numpy.min(eval_neg[0]), numpy.min(dev_pos[0]), numpy.min(eval_pos[0]))
xmax = max(numpy.max(dev_neg[0]), numpy.max(eval_neg[0]), numpy.max(dev_pos[0]), numpy.max(eval_pos[0]))
# keep id of the current system
sys = idx
# if the id of the current system does not match the id of the plot,
......@@ -968,16 +970,16 @@ class Hist(GridSubplot):
if not self._hide_dev or not self._eval:
self._print_subplot(
idx, sys, dev_neg, dev_pos, threshold, not self._no_line, False
idx, sys, dev_neg, dev_pos, threshold, not self._no_line, False, xlim=(xmin, xmax)
)
if self._eval:
idx += self._ncols if not self._hide_dev else 0
self._print_subplot(
idx, sys, eval_neg, eval_pos, threshold, not self._no_line, True
idx, sys, eval_neg, eval_pos, threshold, not self._no_line, True, xlim=(xmin, xmax)
)
def _print_subplot(self, idx, sys, neg, pos, threshold, draw_line, evaluation):
def _print_subplot(self, idx, sys, neg, pos, threshold, draw_line, evaluation, xlim=None):
""" print a subplot for the given score and subplot index"""
n = idx % self._step_print
col = n % self._ncols
......@@ -995,6 +997,8 @@ class Hist(GridSubplot):
is_lower = evaluation or not self._eval
if is_lower and sys_idx + self._ncols >= min(sys_per_page, rest_print):
axis.set_xlabel(self._x_label)
if xlim is not None:
axis.set_xlim(xlim)
dflt_title = "Eval. scores" if evaluation else "Dev. scores"
if self.n_systems == 1 and (not self._eval or self._hide_dev):
dflt_title = " "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment