Commit 26cac9fe authored by ulrich_y's avatar ulrich_y
Browse files

Pass optional arguments through twopanel and threepanel

parent 1e76e630
......@@ -170,7 +170,10 @@ def twopanel(labelx="",
else:
axs[0].set_ylabel(**labupleft)
for i, c in zip(upleft, colupleft):
errorband(i, ax=axs[0], col=c)
if type(i) == dict:
errorband(ax=axs[0], col=c, **i)
else:
errorband(i, ax=axs[0], col=c)
if len(upright) > 0:
ax2 = axs[0].twinx()
......@@ -181,7 +184,10 @@ def twopanel(labelx="",
else:
ax2.set_ylabel(**labupright)
for i, c in zip(upright, colupright):
errorband(i, ax=ax2, col=c)
if type(i) == dict:
errorband(ax=ax2, col=c, **i)
else:
errorband(i, ax=ax2, col=c)
if len(upalign) == 2:
mpl_axes_aligner.yaxes(
axs[0], ax2,
......@@ -193,7 +199,10 @@ def twopanel(labelx="",
else:
axs[1].set_ylabel(**labdownleft)
for i, c in zip(downleft, coldownleft):
errorband(i, ax=axs[1], col=c)
if type(i) == dict:
errorband(ax=axs[1], col=c, **i)
else:
errorband(i, ax=axs[1], col=c)
if len(downright) > 0:
ax3 = axs[1].twinx()
......@@ -204,7 +213,10 @@ def twopanel(labelx="",
else:
ax3.set_ylabel(**labdownright)
for i, c in zip(downright, coldownright):
errorband(i, ax=ax3, col=c)
if type(i) == dict:
errorband(ax=ax3, col=c, **i)
else:
errorband(i, ax=ax3, col=c)
if len(downalign) == 2:
mpl_axes_aligner.yaxes(
axs[1], ax3,
......@@ -240,21 +252,30 @@ def threepanel(labelx="",
else:
axs[0].set_ylabel(**labupleft)
for i, c in zip(upleft, colupleft):
errorband(i, ax=axs[0], col=c)
if type(i) == dict:
errorband(ax=axs[0], col=c, **i)
else:
errorband(i, ax=axs[0], col=c)
if type(labmiddleleft) == str:
axs[1].set_ylabel(labmiddleleft)
else:
axs[1].set_ylabel(**labmiddleleft)
for i, c in zip(middleleft, colmiddleleft):
errorband(i, ax=axs[1], col=c)
if type(i) == dict:
errorband(ax=axs[0], col=c, **i)
else:
errorband(i, ax=axs[1], col=c)
if type(labdownleft) == str:
axs[2].set_ylabel(labdownleft)
else:
axs[2].set_ylabel(**labdownleft)
for i, c in zip(downleft, coldownleft):
errorband(i, ax=axs[2], col=c)
if type(i) == dict:
errorband(ax=axs[2], col=c, **i)
else:
errorband(i, ax=axs[2], col=c)
return fig, axs
......@@ -263,6 +284,7 @@ def kplot(sigma, labelx='$x_e$', labelsigma=None,
labelknlo="$K^{(1)}$", labelknnlo="$K^{(2)}$",
legend={'lo': r'$\rm LO$', 'nlo': r'$\rm NLO$', 'nnlo': r'$\rm NNLO$'},
legendopts={'what': 'l', 'loc': 'upper right'},
linestyle2=':',
show=[0,-1], showk=[1,2], nomule=False):
"""
kplot(sigma, ...) produces a K factor plot in line with McMule's
......@@ -289,7 +311,9 @@ def kplot(sigma, labelx='$x_e$', labelsigma=None,
available), 0 indicates the LO cross section, 1 the NLO etc. -1
indicates the last given cross section
legend: a dict with the legend for "lo", "nlo", "nnlo"
legend: a dict with the legend for "lo", "nlo", "nnlo". The keys
"nlo2" and "nnlo2" are optional and will be drawn dashed in the
lower panel.
legendopts: a kwargs dict of options to be passed to legend(..) as
well as the "what"-key indicating whether the legend such be
......@@ -374,9 +398,25 @@ def kplot(sigma, labelx='$x_e$', labelsigma=None,
if 1 in showk:
kwargs['downleft'] = divideplots(sigma['nlo'], xsec['lo'], offset=1)
kwargs['coldownleft'] = [orderscheme['nlo']]
if "nlo2" in sigma:
kwargs['downleft'] = [
kwargs['downleft'],
{'p': divideplots(sigma['nlo2'], xsec['lo'], offset=1), 'linestyle': linestyle2}
]
kwargs['coldownleft'] *= 2
if 2 in showk:
kwargs['downright'] = divideplots(sigma['nnlo'], xsec['nlo'], offset=1)
kwargs['coldownright'] = [orderscheme['nnlo']]
if "nnlo2" in sigma:
if "nlo2" in sigma:
nlo2 = sigma['nlo2']
else:
nlo2 = sigma['nlo']
kwargs['downright'] = [
kwargs['downright'],
{'p': divideplots(sigma['nnlo2'], addplots(nlo2, xsec['lo']), offset=1), 'linestyle': linestyle2}
]
kwargs['coldownright'] *= 2
kwargs['upleft'] = [
xsec[orders[i]] for i in show
......
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