Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traceplot legend #1070

Merged
merged 13 commits into from
Mar 1, 2020
Prev Previous commit
Next Next commit
docstring changes
OriolAbril committed Mar 1, 2020
commit 27836507e5e40f37545ac799cddcb93ba8a51094
3 changes: 0 additions & 3 deletions arviz/plots/backends/matplotlib/traceplot.py
Original file line number Diff line number Diff line change
@@ -55,9 +55,6 @@ def plot_trace(
lines : tuple or list
list of tuple of (var_name, {'coord': selection}, [line_positions]) to be overplotted as
vertical lines on the density and horizontal lines on the trace.
compact : bool
Flag for combining multidimensional variables into a single line.
If False (default), each dimension will be plotted separately.
combined : bool
Flag for combining multiple chains into a single line. If False (default), chains will be
plotted separately.
23 changes: 12 additions & 11 deletions arviz/plots/traceplot.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
"""Plot kde or histograms and values from MCMC samples."""
from itertools import cycle
import warnings
from typing import Callable, List, Optional, Tuple

import matplotlib.pyplot as plt

from .plot_utils import get_plotting_function, get_coords, xarray_var_iter
from ..data import convert_to_dataset
from ..data import convert_to_dataset, InferenceData, CoordSpec
from ..utils import _var_names
from ..rcparams import rcParams


def plot_trace(
data,
var_names=None,
transform=None,
coords=None,
divergences="bottom",
figsize=None,
data: InferenceData,
var_names: Optional[List[str]]=None,
transform: Optional[Callable]=None,
coords: Optional[CoordSpec]=None,
divergences: Optional[str]="bottom",
figsize: Optional[Tuple[float, float]]=None,
rug=False,
lines=None,
compact=False,
@@ -47,7 +48,7 @@ def plot_trace(
Refer to documentation of az.convert_to_dataset for details
var_names : string, or list of strings
One or more variables to be plotted.
coords : mapping, optional
coords : dict of {str: slice or array_like}, optional
Coordinates of var_names to be plotted. Passed to `Dataset.sel`
divergences : {"bottom", "top", None, False}
Plot location of divergences on the traceplots. Options are "bottom", "top", or False-y.
@@ -83,11 +84,11 @@ def plot_trace(
Extra keyword arguments passed to `arviz.plot_dist`. Only affects discrete variables.
trace_kwargs : dict
Extra keyword arguments passed to `plt.plot`
backend: str, optional
backend : str, optional
Select plotting backend {"matplotlib","bokeh"}. Default "matplotlib".
backend_config: dict, optional
backend_config : dict, optional
Currently specifies the bounds to use for bokeh axes. Defaults to value set in rcParams.
backend_kwargs: bool, optional
backend_kwargs : bool, optional
These are kwargs specific to the backend being used. For additional documentation
check the plotting method of the backend.
show : bool, optional