Commit be3d9fe6 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Respect the --no-disp-legend option

parent 0b85f0c6
Pipeline #21733 canceled with stage
in 21 minutes and 53 seconds
......@@ -222,11 +222,12 @@ class Epsc(VulnPlot):
self._fixed_params = fixed_params or [0.5]
self._titles = ctx.meta.get('titles', []) * 2
self._legend_loc = self._legend_loc or 'upper center'
self._disp_legend = ctx.meta.get('disp_legend', True)
self._eval = True # always eval data with EPC
self._split = False
self._nb_figs = 1
self._sampling = ctx.meta.get('sampling', 5)
mpl.grid(True)
mpl.rcParams['axes.grid'] = True
self._axis1 = None
self._axis2 = None
......@@ -355,10 +356,12 @@ class Epsc(VulnPlot):
idx == self.n_systems - 1:
# all plots share same legends
lines, labels = self._axis1.get_legend_handles_labels()
mpl.gcf().legend(
lines, labels, loc=self._legend_loc, fancybox=True, mode="expand",
framealpha=0.5, ncol=self._nlegends, bbox_to_anchor=(0., 1.12, 1., .102)
)
if self._disp_legend:
mpl.gcf().legend(
lines, labels, loc=self._legend_loc, fancybox=True,
mode="expand", framealpha=0.5, ncol=self._nlegends,
bbox_to_anchor=(0., 1.12, 1., .102)
)
mpl.tight_layout()
self._pdf_page.savefig(bbox_inches='tight')
......
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