Skip to content
Snippets Groups Projects
Commit 1e1c696a authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Adds a simple fix for cases where the result has one dimension and a

corner plot is requested
parent f9f6c3a3
No related branches found
No related tags found
1 merge request!809Adds a simple fix for cases one dimension result corner plots
Pipeline #132686 passed
...@@ -1074,7 +1074,15 @@ class Result(object): ...@@ -1074,7 +1074,15 @@ class Result(object):
# Create the data array to plot and pass everything to corner # Create the data array to plot and pass everything to corner
xs = self.posterior[plot_parameter_keys].values xs = self.posterior[plot_parameter_keys].values
fig = corner.corner(xs, **kwargs) if len(plot_parameter_keys) > 1:
fig = corner.corner(xs, **kwargs)
else:
ax = kwargs.get("ax", plt.subplot())
ax.hist(xs, bins=kwargs["bins"], color=kwargs["color"],
histtype="step", **kwargs["hist_kwargs"])
ax.set_xlabel(kwargs["labels"][0])
fig = plt.gcf()
axes = fig.get_axes() axes = fig.get_axes()
# Add the titles # Add the titles
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment