Fix bug when plotting maximum likelihood point in create_multidim_plot
#4942
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a bugfix to the
create_multidim_plot
function inscatter_histograms.py
. Specifying--plot-maxl
does not plot the expected maximum likelihood point when used in conjunction with--plot-scatter
in multidimensional plots. Currently,plot-maxl
selects the index of the max likelihood sample beforeplot-scatter
sorts the samples by their z argument. When both options are specified, the selected maxL index will generally not correspond to the maxL sample in the newly sorted array.This PR moves the indexing selection for
plot-maxl
after the samples are sorted byplot-scatter
. This should have no effect if using either option separately with codes usingcreate_multidim_plot
(e.g.pycbc_inference_plot_posterior
), but should now correctly plot the maxL sample if both are specified.