Maintenance will be performed on git.ligo.org, chat.ligo.org, containers.ligo.org, and docs.ligo.org on Tuesday 7th July 2020 starting at approximately 10am PDT and lasting for around 15 minutes. There will be a short period of downtime towards the end of the maintenance window. Please direct any comments, questions, or concerns to uwm-help@cgca.uwm.edu.

Commit 45624ece authored by Moritz Huebner's avatar Moritz Huebner

Merge branch '357-gwpy-breaking-legend-plots' into 'master'

Resolve "`gwpy` breaking legend plots"

Closes #357

See merge request !497
parents a4eef56a 48a6c8ce
Pipeline #62603 passed with stages
in 15 minutes and 37 seconds
......@@ -1447,7 +1447,8 @@ def plot_multiple(results, filename=None, labels=None, colours=None,
def make_pp_plot(results, filename=None, save=True, confidence_interval=0.9,
lines=None, legend_fontsize=9, keys=None, **kwargs):
lines=None, legend_fontsize=9, keys=None, title=True,
**kwargs):
"""
Make a P-P plot for a set of runs with injected signals.
......@@ -1515,7 +1516,16 @@ def make_pp_plot(results, filename=None, save=True, confidence_interval=0.9,
pvalues.append(pvalue)
logger.info("{}: {}".format(key, pvalue))
ax.legend(fontsize=legend_fontsize)
Pvals = namedtuple('pvals', ['combined_pvalue', 'pvalues', 'names'])
pvals = Pvals(combined_pvalue=scipy.stats.combine_pvalues(pvalues)[1],
pvalues=pvalues,
names=list(credible_levels.keys()))
logger.info(
"Combined p-value: {}".format(pvals.combined_pvalue))
if title:
ax.set_title("p-value = {:2.4f}".format(pvals.combined_pvalue))
ax.legend(linewidth=1, labelspacing=0.25)
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
fig.tight_layout()
......@@ -1524,12 +1534,6 @@ def make_pp_plot(results, filename=None, save=True, confidence_interval=0.9,
filename = 'outdir/pp.png'
fig.savefig(filename, dpi=500)
Pvals = namedtuple('pvals', ['combined_pvalue', 'pvalues', 'names'])
pvals = Pvals(combined_pvalue=scipy.stats.combine_pvalues(pvalues)[1],
pvalues=pvalues,
names=list(credible_levels.keys()))
logger.info(
"Combined p-value: {}".format(pvals.combined_pvalue))
return fig, pvals
......
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