Skip to content
Snippets Groups Projects
Commit 3887fb6d authored by Alex UNNERVIK's avatar Alex UNNERVIK
Browse files

Updated histogram plots to share x and y axis scales across dev and eval among same systems

parent 9fd76ffb
Branches HistXY
No related tags found
No related merge requests found
Pipeline #38959 passed with stage
in 10 minutes and 27 seconds
......@@ -882,12 +882,15 @@ class GridSubplot(PlotBase):
figure=mpl.gcf(),
)
def create_subplot(self, n):
def create_subplot(self, n, shared_axis=None):
i, j = numpy.unravel_index(n, (self._nrows, self._ncols))
i1 = i * self._row_times + self._grid_axis_offset
i2 = (i + 1) * self._row_times + self._grid_axis_offset
j1, j2 = j * self._col_times, (j + 1) * self._col_times
axis = mpl.gcf().add_subplot(self._gs[i1:i2, j1:j2])
if shared_axis is not None:
axis = mpl.gcf().add_subplot(self._gs[i1:i2, j1:j2], sharex=shared_axis, sharey=shared_axis)
else:
axis = mpl.gcf().add_subplot(self._gs[i1:i2, j1:j2])
return axis
def finalize_one_page(self):
......@@ -966,23 +969,26 @@ class Hist(GridSubplot):
col = idx % self._ncols
idx = col + self._ncols * row
dev_axis = None
if not self._hide_dev or not self._eval:
self._print_subplot(
dev_axis = self._print_subplot(
idx, sys, dev_neg, dev_pos, threshold, not self._no_line, False
)
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,
shared_axis=dev_axis)
def _print_subplot(self, idx, sys, neg, pos, threshold, draw_line, evaluation):
def _print_subplot(self, idx, sys, neg, pos, threshold, draw_line, evaluation,
shared_axis=None):
""" print a subplot for the given score and subplot index"""
n = idx % self._step_print
col = n % self._ncols
sub_plot_idx = n + 1
axis = self.create_subplot(n)
axis = self.create_subplot(n, shared_axis)
self._setup_hist(neg, pos)
if col == 0:
axis.set_ylabel(self._y_label)
......@@ -1015,6 +1021,7 @@ class Hist(GridSubplot):
# to display, save figure
if self._step_print == sub_plot_idx or (is_lower and sys == self.n_systems - 1):
self.finalize_one_page()
return axis
def _get_title(self, idx, dflt=None):
""" Get the histo title for the given idx"""
......
  • Author Maintainer

    plot_test.zip

    Here you will find a set of scores, a script which generates plot combinations and a copy of the generated plots.

    Please update the path to the bob binary in the script which contains the update in this commit if you want to use the script and compare the outputs of the plots generated.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment