Commit 14e852f2 authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME

Change defaults behaviors for titles

parent c83442c1
Pipeline #18753 passed with stage
in 25 minutes and 14 seconds
...@@ -126,7 +126,7 @@ def show_dev_option(dflt=False, **kwargs): ...@@ -126,7 +126,7 @@ def show_dev_option(dflt=False, **kwargs):
'''Option to tell if should show dev histo''' '''Option to tell if should show dev histo'''
return bool_option('show-dev', 'D', 'If set, show dev histograms', dflt) return bool_option('show-dev', 'D', 'If set, show dev histograms', dflt)
def print_filenames_option(dflt=False, **kwargs): def print_filenames_option(dflt=True, **kwargs):
'''Option to tell if filenames should be in the title''' '''Option to tell if filenames should be in the title'''
return bool_option('show-fn', 'P', 'If set, show filenames in title', dflt) return bool_option('show-fn', 'P', 'If set, show filenames in title', dflt)
......
...@@ -392,7 +392,7 @@ class PlotBase(MeasureBase): ...@@ -392,7 +392,7 @@ class PlotBase(MeasureBase):
self._axlim = None if 'axlim' not in ctx.meta else ctx.meta['axlim'] self._axlim = None if 'axlim' not in ctx.meta else ctx.meta['axlim']
self._clayout = None if 'clayout' not in ctx.meta else\ self._clayout = None if 'clayout' not in ctx.meta else\
ctx.meta['clayout'] ctx.meta['clayout']
self._print_fn = False if 'show_fn' not in ctx.meta else\ self._print_fn = True if 'show_fn' not in ctx.meta else\
ctx.meta['show_fn'] ctx.meta['show_fn']
self._x_rotation = None if 'x_rotation' not in ctx.meta else \ self._x_rotation = None if 'x_rotation' not in ctx.meta else \
ctx.meta['x_rotation'] ctx.meta['x_rotation']
...@@ -657,12 +657,11 @@ class Hist(PlotBase): ...@@ -657,12 +657,11 @@ class Hist(PlotBase):
self._get_neg_pos_thres(idx, dev_score, eval_score) self._get_neg_pos_thres(idx, dev_score, eval_score)
fig = mpl.figure() fig = mpl.figure()
mpl.title(self._get_title(dev_file, eval_file))
if eval_neg is not None and self._show_dev: if eval_neg is not None and self._show_dev:
mpl.subplot(2, 1, 1) mpl.subplot(2, 1, 1)
mpl.title(self._get_title(dev_file, eval_file))
if self._show_dev: if self._show_dev:
self._setup_hist(dev_neg, dev_pos) self._setup_hist(dev_neg, dev_pos)
mpl.title(self._get_title(idx, dev_file, eval_file))
mpl.ylabel(self._y_label) mpl.ylabel(self._y_label)
mpl.xlabel(self._x_label) mpl.xlabel(self._x_label)
if eval_neg is not None and self._show_dev: if eval_neg is not None and self._show_dev:
...@@ -679,6 +678,8 @@ class Hist(PlotBase): ...@@ -679,6 +678,8 @@ class Hist(PlotBase):
self._setup_hist( self._setup_hist(
eval_neg, eval_pos eval_neg, eval_pos
) )
if not self._show_dev:
mpl.title(self._get_title(idx, dev_file, eval_file))
mpl.ylabel('Eval. probability density') mpl.ylabel('Eval. probability density')
mpl.xlabel(self._x_label) mpl.xlabel(self._x_label)
#Setup lines, corresponding axis and legends #Setup lines, corresponding axis and legends
...@@ -689,7 +690,9 @@ class Hist(PlotBase): ...@@ -689,7 +690,9 @@ class Hist(PlotBase):
fig.set_tight_layout(True) fig.set_tight_layout(True)
self._pdf_page.savefig(fig) self._pdf_page.savefig(fig)
def _get_title(self, dev_file, eval_file): def _get_title(self, idx, dev_file, eval_file):
title = self._titles[idx] if self._titles is not None else None
if title is None:
title = self._title_base if not self._print_fn else \ title = self._title_base if not self._print_fn else \
('%s (%s)' % ( ('%s (%s)' % (
self._title_base, self._title_base,
......
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