pycbc icon indicating copy to clipboard operation
pycbc copied to clipboard

Bug in pycbc_inference_plot_posterior

Open spxiwh opened this issue 4 years ago • 1 comments

The conditional here:

https://github.com/gwastro/pycbc/blob/master/pycbc/results/scatter_histograms.py#L598

is buggy. If there are 2 parameters and --plot-marginal is not given then only one image is created in the corner plot and the length of width_ratios and height_ratios must be 1.

This should be reproducible with any inference output with something like:

pycbc_inference_plot_posterior --plot-scatter --input-file test.hdf --output-file test.png --z-arg snr --verbose --parameters "mass1" "mass2"```

Just need exactly 2 parameters and no `--plot-marginal`. Not sure what exactly this line is doing, so unsure how to suggest a fix (other than just delete the conditional).

spxiwh avatar Sep 03 '21 11:09 spxiwh

@spxiwh From just a glance, it looks to me like it is just trying to set the relative width of the marginal plot to the 2d plot. In the case of a single 2d plot, I think it is just a space optimization. I agree with your report and I think the solution is simply to add a requirement to the conditional that the marginal plot option be on.

ahnitz avatar Sep 03 '21 11:09 ahnitz