From 3fa26cfd9ff31709c6e2cd29e47743d9e222567a Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 31 May 2019 10:31:05 -0400 Subject: [PATCH] Use compact traceplot by default (#3502) * Use compact traceplot by default * Protect against old values of arviz --- pymc3/plots/__init__.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pymc3/plots/__init__.py b/pymc3/plots/__init__.py index 9e59a2fa103..25abe3e2f0b 100644 --- a/pymc3/plots/__init__.py +++ b/pymc3/plots/__init__.py @@ -47,11 +47,21 @@ def wrapped(*args, **kwargs): forestplot = map_args(az.plot_forest) kdeplot = map_args(az.plot_kde) plot_posterior = map_args(az.plot_posterior) -traceplot = map_args(az.plot_trace) energyplot = map_args(az.plot_energy) densityplot = map_args(az.plot_density) pairplot = map_args(az.plot_pair) +# Use compact traceplot by default +@map_args +@functools.wraps(az.plot_trace) +def traceplot(*args, **kwargs): + try: + kwargs.setdefault('compact', True) + return az.plot_trace(*args, **kwargs) + except TypeError: + kwargs.pop('compact') + return az.plot_trace(*args, **kwargs) + # addition arg mapping for compare plot @functools.wraps(az.plot_compare) def compareplot(*args, **kwargs):