(gallery_pair_focus)=

# Scatter plot of one variable against all other variables with divergences

Plot one variable against other variables in the dataset.



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

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

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

:::::

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

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

from bokeh.plotting import show

import numpy as np
from arviz_base import load_arviz_data

import arviz_plots as azp

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

dt = load_arviz_data("centered_eight")
dt.posterior["log_tau"] = np.log(dt.posterior["tau"])

pc = azp.plot_pair_focus(
dt,
var_names=["theta"],
focus_var="log_tau",
visuals={"divergence":True},
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/plot_pair_focus.html?backend=bokeh#synchronised-tabs)
:::::

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

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

import numpy as np
from arviz_base import load_arviz_data

import arviz_plots as azp

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

dt = load_arviz_data("centered_eight")
dt.posterior["log_tau"] = np.log(dt.posterior["tau"])

pc = azp.plot_pair_focus(
dt,
var_names=["theta"],
focus_var="log_tau",
visuals={"divergence":True},
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/plot_pair_focus.html?backend=plotly#synchronised-tabs)
:::::
::::::

```{literalinclude} _scripts/plot_pair_focus.py
:emphasize-lines: 16
```



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



## Other examples with `plot_pair_focus`

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


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