Skip to content

Commit

Permalink
move plot_maxl after sorting to fix index bug (gwastro#4942)
Browse files Browse the repository at this point in the history
  • Loading branch information
acorreia61201 authored and prayush committed Nov 21, 2024
1 parent 011420b commit 7f44c34
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pycbc/results/scatter_histograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,12 +679,6 @@ def create_multidim_plot(parameters, samples, labels=None,
else:
width_ratios = height_ratios = None

if plot_maxl:
# make sure loglikelihood is provide
if 'loglikelihood' not in samples.fieldnames:
raise ValueError("plot-maxl requires loglikelihood")
maxidx = samples['loglikelihood'].argmax()

# only plot scatter if more than one parameter
plot_scatter = plot_scatter and nparams > 1

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

if plot_maxl:
# make sure loglikelihood is provide
if 'loglikelihood' not in samples.fieldnames:
raise ValueError("plot-maxl requires loglikelihood")
maxidx = samples['loglikelihood'].argmax()

# create the axis grid
if fig is None and axis_dict is None:
fig, axis_dict = create_axes_grid(
Expand Down

0 comments on commit 7f44c34

Please sign in to comment.