(gallery_combine_plots)=

# Custom diagnostic plots combination

Arrange three diagnostic plots (ESS evolution plot, rank plot and autocorrelation plot)
in a custom column layout.



::::::{tab-set}
:class: full-width
:sync-group: backend

:::::{tab-item} Matplotlib
:sync: matplotlib

![Matplotlib version of combine_plots](_images/combine_plots.png)

:::::

:::::{tab-item} Bokeh
:sync: bokeh

```{bokeh-plot}
:source-position: none

from bokeh.plotting import show

from arviz_base import load_arviz_data

import arviz_plots as azp

azp.style.use("arviz-variat")

data = load_arviz_data("non_centered_eight")
pc = azp.combine_plots(
data,
[
(azp.plot_ess_evolution, {}),
(azp.plot_rank, {}),
(azp.plot_autocorr, {}),
],
var_names=["theta", "mu", "tau"],
coords={"school": ["Hotchkiss", "St. Paul's"]},
backend="bokeh",  # change to preferred backend
)


# for some reason the bokeh plot extension needs explicit use of show
show(pc.viz["figure"].item() if pc.viz["figure"].item() is not None else pc.viz["plot"].item())
```

Link to this page with the [bokeh tab selected](https://arviz-plots.readthedocs.io/en/latest//gallery/combine_plots.html?backend=bokeh#synchronised-tabs)
:::::

:::::{tab-item} Plotly
:sync: plotly

```{jupyter-execute}
:hide-code:

from arviz_base import load_arviz_data

import arviz_plots as azp

azp.style.use("arviz-variat")

data = load_arviz_data("non_centered_eight")
pc = azp.combine_plots(
data,
[
(azp.plot_ess_evolution, {}),
(azp.plot_rank, {}),
(azp.plot_autocorr, {}),
],
var_names=["theta", "mu", "tau"],
coords={"school": ["Hotchkiss", "St. Paul's"]},
backend="plotly",  # change to preferred backend
)
pc.show()
```

Link to this page with the [plotly tab selected](https://arviz-plots.readthedocs.io/en/latest//gallery/combine_plots.html?backend=plotly#synchronised-tabs)
:::::
::::::

```{literalinclude} _scripts/combine_plots.py
:emphasize-lines: 17
```



:::{seealso}
API Documentation: {func}`~arviz_plots.combine_plots`
:::



## Other examples with `combine_plots`

```{eval-rst}
.. minigallery:: combine_plots
```


:::{div} example-plot-download
{download}`Download Python Source Code: combine_plots.py<_scripts/combine_plots.py>`
:::
