Skip to content

Commit 53b1757

Browse files
move plot_maxl after sorting to fix index bug (#4942)
1 parent 3efc80c commit 53b1757

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: pycbc/results/scatter_histograms.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,6 @@ def create_multidim_plot(parameters, samples, labels=None,
679679
else:
680680
width_ratios = height_ratios = None
681681

682-
if plot_maxl:
683-
# make sure loglikelihood is provide
684-
if 'loglikelihood' not in samples.fieldnames:
685-
raise ValueError("plot-maxl requires loglikelihood")
686-
maxidx = samples['loglikelihood'].argmax()
687-
688682
# only plot scatter if more than one parameter
689683
plot_scatter = plot_scatter and nparams > 1
690684

@@ -704,6 +698,12 @@ def create_multidim_plot(parameters, samples, labels=None,
704698
if plot_contours and contour_color is None:
705699
contour_color = 'navy'
706700

701+
if plot_maxl:
702+
# make sure loglikelihood is provide
703+
if 'loglikelihood' not in samples.fieldnames:
704+
raise ValueError("plot-maxl requires loglikelihood")
705+
maxidx = samples['loglikelihood'].argmax()
706+
707707
# create the axis grid
708708
if fig is None and axis_dict is None:
709709
fig, axis_dict = create_axes_grid(

0 commit comments

Comments
 (0)