diff --git a/src/corner/arviz_corner.py b/src/corner/arviz_corner.py index 2461ef3..06acca7 100644 --- a/src/corner/arviz_corner.py +++ b/src/corner/arviz_corner.py @@ -61,6 +61,7 @@ def arviz_corner( truth_color="#4682b4", scale_hist=False, quantiles=None, + quant_linestyle=None, verbose=False, fig=None, max_n_ticks=5, @@ -153,6 +154,7 @@ def arviz_corner( truth_color=truth_color, scale_hist=scale_hist, quantiles=quantiles, + quant_linestyle=quant_linestyle, verbose=verbose, fig=fig, max_n_ticks=max_n_ticks, diff --git a/src/corner/core.py b/src/corner/core.py index bfb3084..4e573ff 100644 --- a/src/corner/core.py +++ b/src/corner/core.py @@ -50,6 +50,7 @@ def corner_impl( truth_color="#4682b4", scale_hist=False, quantiles=None, + quant_linestyle=None, title_quantiles=None, verbose=False, fig=None, @@ -63,6 +64,7 @@ def corner_impl( ): if quantiles is None: quantiles = [] + quant_linestyle = [] if title_kwargs is None: title_kwargs = dict() if label_kwargs is None: @@ -242,9 +244,13 @@ def corner_impl( # Plot quantiles if wanted. if len(quantiles) > 0: qvalues = quantile(x, quantiles, weights=weights) - for q in qvalues: - ax.axvline(q, ls="dashed", color=color) - + for q_i, q in enumerate(qvalues): + if quant_linestyle: + ax.axvline(q, ls=quant_linestyle[q_i], color=color) + else: + ax.axvline(q, ls="dashed", color=color) + # for q in qvalues: + # ax.axvline(q, ls="dashed", color=color) if verbose: print("Quantiles:") print([item for item in zip(quantiles, qvalues)]) diff --git a/src/corner/corner.py b/src/corner/corner.py index 25de026..6a82751 100644 --- a/src/corner/corner.py +++ b/src/corner/corner.py @@ -37,6 +37,7 @@ def corner( truth_color="#4682b4", scale_hist=False, quantiles=None, + quant_linestyle=None, verbose=False, fig=None, max_n_ticks=5, @@ -174,7 +175,11 @@ def corner( quantiles : iterable A list of fractional quantiles to show on the 1-D histograms as - vertical dashed lines. + vertical lines. The default linestyle is 'dashed'. + + quant_linestyle : iterable + A list of linestyle to override the default 'dashed' linestyle. + The size must be equal to that of quantiles. verbose : bool If true, print the values of the computed quantiles. @@ -260,6 +265,7 @@ def corner( truth_color=truth_color, scale_hist=scale_hist, quantiles=quantiles, + quant_linestyle=quant_linestyle, verbose=verbose, fig=fig, max_n_ticks=max_n_ticks, @@ -292,6 +298,7 @@ def corner( truth_color=truth_color, scale_hist=scale_hist, quantiles=quantiles, + quant_linestyle=None, verbose=verbose, fig=fig, max_n_ticks=max_n_ticks,