Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when plotting maximum likelihood point in create_multidim_plot #4942

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading