diff --git a/bilby/core/result.py b/bilby/core/result.py index 96432e066e99acd63f78ce7b28fb16debe417b33..c418482c1a6accabbfae3703a54728f144266a7c 100644 --- a/bilby/core/result.py +++ b/bilby/core/result.py @@ -1093,7 +1093,15 @@ class Result(object): # Create the data array to plot and pass everything to corner 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() # Add the titles