diff --git a/bilby/core/result.py b/bilby/core/result.py index 4bff8e46186c6405013ebc11aa9bcde248745396..077fa8b4c805683cb7ad0643502bfb81f8956808 100644 --- a/bilby/core/result.py +++ b/bilby/core/result.py @@ -1074,7 +1074,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