Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/corner/arviz_corner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
12 changes: 9 additions & 3 deletions src/corner/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down Expand Up @@ -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)])
Expand Down
9 changes: 8 additions & 1 deletion src/corner/corner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down