ArviZ-plots
ArviZ-plots is a new Python library (v1.0.0) designed to provide ready-to-use and composable plots specifically for Bayesian workflow. It offers a flexible and modular plotting interface, building upon ArviZ's `InferenceData` object for modern visualization needs. As a `1.0.0` release, it aims for API stability in future patch versions.
Common errors
-
ModuleNotFoundError: No module named 'arviz_plots'
cause The arviz-plots library is not installed in your current Python environment.fixRun `pip install arviz-plots` to install the package. -
TypeError: plot_pair() missing 1 required positional argument: 'data'
cause A plotting function like `plot_pair` was called without providing the necessary `InferenceData` object.fixPass an `arviz.InferenceData` object as the first argument, e.g., `plot_pair(idata)`. -
ERROR: Package 'arviz-plots' requires a different Python version: 3.12 or later but 'X.Y' is specified.
cause Your current Python version does not meet the minimum requirement (Python 3.12).fixUpgrade your Python environment to version 3.12 or newer. Consider using a virtual environment with the correct Python version.
Warnings
- gotcha ArviZ-plots is designed to work exclusively with `arviz.InferenceData` objects. Providing other data structures will lead to errors.
- gotcha ArviZ-plots is not a direct, drop-in replacement for *all* `arviz.plot_*` functions. While it offers similar plots, its API is different and focuses on composability. Not all ArviZ plots are yet implemented in arviz-plots, or they may have different parameters.
- breaking ArviZ-plots requires Python 3.12 or newer. Installing or running the library on older Python versions will fail.
- breaking As a new `1.0.0` release, while patch releases will aim for API stability, future *major* versions (e.g., `2.0.0`) are likely to introduce significant API changes to refine the composable plotting interface and integrate new features.
Install
-
pip install arviz-plots
Imports
- plot_pair
from arviz_plots import plot_pair
- plot_trace
from arviz_plots import plot_trace
- Plot
from arviz_plots.base import Plot
Quickstart
import arviz as az
from arviz_plots import plot_pair
# Load example InferenceData from ArviZ
idata = az.load_arviz_data("centered_eight")
# Create a basic pair plot
plot_pair(idata)