We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add docs references to plot_joint docstring
Add links to the related functions and classes to all the places where they are mentioned in the [plot_joint](https://arviz-devs.github.io/arviz/api/generated/arviz.plot_joint.html) docstring.

## Sample PR:
You can see https://github.com/arviz-devs/arviz/pull/1816 for the function, `plot_autocorr`. 

## Source File
Source file: https://github.com/arviz-devs/arviz/blob/main/arviz/plots/jointplot.py

## How to add links
Add the links in the docstring of doc. You can also check the docstring by going to the `[source]`. 

* Add links to the ArviZ functions and classes using [Cross-referencing with Sphinx](https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html).
* Add links to the xarray functions and classes using [Intersphinx](https://docs.readthedocs.io/en/stable/guides/intersphinx.html).
* Add the rest of the external links using this [syntax](https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html#links-to-external-web-pages).

## `backend_kwargs`, `marginal_kwargs` and `joint_kwargs`
For adding `backend_kwargs` as they have been added in #1816, see [Adding backend_kwargs guide](https://github.com/arviz-devs/arviz/wiki/ArviZ-Hacktoberfest-2021#adding-backend_kwargs). Follow the same process for `marginal_kwargs ` and `joint_kwargs`.

## See also section
Add the following functions in the "See also" section:
1. [plot_pair](https://arviz-devs.github.io/arviz/api/generated/arviz.plot_pair.html)

See [Adding "see also" section](https://github.com/arviz-devs/arviz/wiki/ArviZ-Hacktoberfest-2021#adding-see-also-section) for more details. 

## Checking the preview of docs
For checking the preview of docs, you don't need t set up the project on your local machine. Just follow the [checking the preview guide](https://github.com/arviz-devs/arviz/wiki/ArviZ-Hacktoberfest-2021#how-to-check-the-preview-of-docs). 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `arviz/plots/jointplot.py`
Content:
```
1 """Joint scatter plot of two variables."""
2 import warnings
3 
4 from ..data import convert_to_dataset
5 from ..sel_utils import xarray_var_iter
6 from ..rcparams import rcParams
7 from ..utils import _var_names, get_coords
8 from .plot_utils import get_plotting_function
9 
10 
11 def plot_joint(
12     data,
13     group="posterior",
14     var_names=None,
15     filter_vars=None,
16     transform=None,
17     coords=None,
18     figsize=None,
19     textsize=None,
20     kind="scatter",
21     gridsize="auto",
22     contour=True,
23     fill_last=True,
24     joint_kwargs=None,
25     marginal_kwargs=None,
26     ax=None,
27     backend=None,
28     backend_kwargs=None,
29     show=None,
30 ):
31     """
32     Plot a scatter or hexbin of two variables with their respective marginals distributions.
33 
34     Parameters
35     ----------
36     data: obj
37         Any object that can be converted to an az.InferenceData object
38         Refer to documentation of az.convert_to_dataset for details
39     group: str, optional
40         Specifies which InferenceData group should be plotted. Defaults to ‘posterior’.
41     var_names: str or iterable of str
42         Variables to be plotted. Iterable of two variables or one variable (with subset
43         having exactly 2 dimensions) are required. Prefix the variables by `~` when you
44         want to exclude them from the plot.
45     filter_vars: {None, "like", "regex"}, optional, default=None
46         If `None` (default), interpret var_names as the real variables names. If "like",
47         interpret var_names as substrings of the real variables names. If "regex",
48         interpret var_names as regular expressions on the real variables names. A la
49         `pandas.filter`.
50     transform: callable
51         Function to transform data (defaults to None i.e. the identity function)
52     coords: mapping, optional
53         Coordinates of var_names to be plotted. Passed to `Dataset.sel`
54     figsize: tuple
55         Figure size. If None it will be defined automatically.
56     textsize: float
57         Text size scaling factor for labels, titles and lines. If None it will be autoscaled based
58         on figsize.
59     kind: str
60         Type of plot to display (scatter, kde or hexbin)
61     gridsize: int or (int, int), optional.
62         The number of hexagons in the x-direction. Ignored when hexbin is False. See `plt.hexbin`
63         for details
64     contour: bool
65         If True plot the 2D KDE using contours, otherwise plot a smooth 2D KDE. Defaults to True.
66     fill_last: bool
67         If True fill the last contour of the 2D KDE plot. Defaults to True.
68     joint_kwargs: dicts, optional
69         Additional keywords modifying the join distribution (central subplot)
70     marginal_kwargs: dicts, optional
71         Additional keywords modifying the marginals distributions (top and right subplot)
72     ax: tuple of axes, optional
73         Tuple containing (ax_joint, ax_hist_x, ax_hist_y). If None, a new figure and axes
74         will be created. Matplotlib axes or bokeh figures.
75     backend: str, optional
76         Select plotting backend {"matplotlib","bokeh"}. Default "matplotlib".
77     backend_kwargs: bool, optional
78         These are kwargs specific to the backend being used. For additional documentation
79         check the plotting method of the backend.
80     show: bool, optional
81         Call backend show function.
82 
83     Returns
84     -------
85     axes: matplotlib axes or bokeh figures
86         ax_joint: joint (central) distribution
87         ax_hist_x: x (top) distribution
88         ax_hist_y: y (right) distribution
89 
90     Examples
91     --------
92     Scatter Joint plot
93 
94     .. plot::
95         :context: close-figs
96 
97         >>> import arviz as az
98         >>> data = az.load_arviz_data('non_centered_eight')
99         >>> az.plot_joint(data,
100         >>>             var_names=['theta'],
101         >>>             coords={'school': ['Choate', 'Phillips Andover']},
102         >>>             kind='scatter',
103         >>>             figsize=(6, 6))
104 
105     Hexbin Joint plot
106 
107     .. plot::
108         :context: close-figs
109 
110         >>> az.plot_joint(data,
111         >>>             var_names=['theta'],
112         >>>             coords={'school': ['Choate', 'Phillips Andover']},
113         >>>             kind='hexbin',
114         >>>             figsize=(6, 6))
115 
116     KDE Joint plot
117 
118     .. plot::
119         :context: close-figs
120 
121         >>> az.plot_joint(data,
122         >>>                 var_names=['theta'],
123         >>>                 coords={'school': ['Choate', 'Phillips Andover']},
124         >>>                 kind='kde',
125         >>>                 figsize=(6, 6))
126 
127     Overlaid plots:
128 
129     .. plot::
130         :context: close-figs
131 
132         >>> data2 = az.load_arviz_data("centered_eight")
133         >>> kde_kwargs = {"contourf_kwargs": {"alpha": 0}, "contour_kwargs": {"colors": "k"}}
134         >>> ax = az.plot_joint(
135         ...     data, var_names=("mu", "tau"), kind="kde", fill_last=False,
136         ...     joint_kwargs=kde_kwargs, marginal_kwargs={"color": "k"}
137         ... )
138         >>> kde_kwargs["contour_kwargs"]["colors"] = "r"
139         >>> az.plot_joint(
140         ...     data2, var_names=("mu", "tau"), kind="kde", fill_last=False,
141         ...     joint_kwargs=kde_kwargs, marginal_kwargs={"color": "r"}, ax=ax
142         ... )
143 
144     """
145     warnings.warn("plot_joint will be deprecated. Please use plot_pair instead.")
146 
147     valid_kinds = ["scatter", "kde", "hexbin"]
148     if kind not in valid_kinds:
149         raise ValueError(
150             ("Plot type {} not recognized." "Plot type must be in {}").format(kind, valid_kinds)
151         )
152 
153     data = convert_to_dataset(data, group=group)
154 
155     if transform is not None:
156         data = transform(data)
157 
158     if coords is None:
159         coords = {}
160 
161     var_names = _var_names(var_names, data, filter_vars)
162 
163     plotters = list(xarray_var_iter(get_coords(data, coords), var_names=var_names, combined=True))
164 
165     if len(plotters) != 2:
166         raise Exception(f"Number of variables to be plotted must 2 (you supplied {len(plotters)})")
167 
168     plot_joint_kwargs = dict(
169         ax=ax,
170         figsize=figsize,
171         plotters=plotters,
172         kind=kind,
173         contour=contour,
174         fill_last=fill_last,
175         joint_kwargs=joint_kwargs,
176         gridsize=gridsize,
177         textsize=textsize,
178         marginal_kwargs=marginal_kwargs,
179         backend_kwargs=backend_kwargs,
180         show=show,
181     )
182 
183     if backend is None:
184         backend = rcParams["plot.backend"]
185     backend = backend.lower()
186 
187     # TODO: Add backend kwargs
188     plot = get_plotting_function("plot_joint", "jointplot", backend)
189     axes = plot(**plot_joint_kwargs)
190     return axes
191
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/arviz/plots/jointplot.py b/arviz/plots/jointplot.py
--- a/arviz/plots/jointplot.py
+++ b/arviz/plots/jointplot.py
@@ -31,36 +31,40 @@
     """
     Plot a scatter or hexbin of two variables with their respective marginals distributions.
 
+    .. deprecated:: 0.9.0
+        Use :func:`arviz.plot_pair` instead.
+
     Parameters
     ----------
     data: obj
-        Any object that can be converted to an az.InferenceData object
-        Refer to documentation of az.convert_to_dataset for details
+        Any object that can be converted to an :class:`arviz.InferenceData` object
+        Refer to documentation of :func:`arviz.convert_to_dataset` for details.
     group: str, optional
-        Specifies which InferenceData group should be plotted. Defaults to ‘posterior’.
+        Specifies which :class:`arviz.InferenceData` group should be plotted.
+        Defaults to "posterior".
     var_names: str or iterable of str
         Variables to be plotted. Iterable of two variables or one variable (with subset
-        having exactly 2 dimensions) are required. Prefix the variables by `~` when you
+        having exactly 2 dimensions) are required. Prefix the variables by ``~`` when you
         want to exclude them from the plot.
     filter_vars: {None, "like", "regex"}, optional, default=None
         If `None` (default), interpret var_names as the real variables names. If "like",
         interpret var_names as substrings of the real variables names. If "regex",
         interpret var_names as regular expressions on the real variables names. A la
-        `pandas.filter`.
+        ``pandas.filter``.
     transform: callable
         Function to transform data (defaults to None i.e. the identity function)
     coords: mapping, optional
-        Coordinates of var_names to be plotted. Passed to `Dataset.sel`
+        Coordinates of var_names to be plotted, passed to :meth:`xarray.Dataset.sel`
     figsize: tuple
         Figure size. If None it will be defined automatically.
     textsize: float
         Text size scaling factor for labels, titles and lines. If None it will be autoscaled based
         on figsize.
     kind: str
-        Type of plot to display (scatter, kde or hexbin)
+        Type of plot to display ("scatter", "kde" or "hexbin")
     gridsize: int or (int, int), optional.
-        The number of hexagons in the x-direction. Ignored when hexbin is False. See `plt.hexbin`
-        for details
+        The number of hexagons in the x-direction. Ignored when hexbin is False.
+        See :func:`matplotlib.pyplot.hexbin` for details.
     contour: bool
         If True plot the 2D KDE using contours, otherwise plot a smooth 2D KDE. Defaults to True.
     fill_last: bool
@@ -73,10 +77,11 @@
         Tuple containing (ax_joint, ax_hist_x, ax_hist_y). If None, a new figure and axes
         will be created. Matplotlib axes or bokeh figures.
     backend: str, optional
-        Select plotting backend {"matplotlib","bokeh"}. Default "matplotlib".
+        Select plotting backend {"matplotlib","bokeh"}. Defaults to "matplotlib".
     backend_kwargs: bool, optional
-        These are kwargs specific to the backend being used. For additional documentation
-        check the plotting method of the backend.
+        These are kwargs specific to the backend being used, passed to
+        :func:`matplotlib.pyplot.figure` or
+        :func:`bokeh.plotting.figure`.
     show: bool, optional
         Call backend show function.
 
@@ -87,6 +92,10 @@
         ax_hist_x: x (top) distribution
         ax_hist_y: y (right) distribution
 
+    See Also
+    --------
+    plot_pair : Plot a scatter, kde and/or hexbin matrix with (optional) marginals on the diagonal.
+
     Examples
     --------
     Scatter Joint plot

{"golden_diff": "diff --git a/arviz/plots/jointplot.py b/arviz/plots/jointplot.py\n--- a/arviz/plots/jointplot.py\n+++ b/arviz/plots/jointplot.py\n@@ -31,36 +31,40 @@\n     \"\"\"\n     Plot a scatter or hexbin of two variables with their respective marginals distributions.\n \n+    .. deprecated:: 0.9.0\n+        Use :func:`arviz.plot_pair` instead.\n+\n     Parameters\n     ----------\n     data: obj\n-        Any object that can be converted to an az.InferenceData object\n-        Refer to documentation of az.convert_to_dataset for details\n+        Any object that can be converted to an :class:`arviz.InferenceData` object\n+        Refer to documentation of :func:`arviz.convert_to_dataset` for details.\n     group: str, optional\n-        Specifies which InferenceData group should be plotted. Defaults to \u2018posterior\u2019.\n+        Specifies which :class:`arviz.InferenceData` group should be plotted.\n+        Defaults to \"posterior\".\n     var_names: str or iterable of str\n         Variables to be plotted. Iterable of two variables or one variable (with subset\n-        having exactly 2 dimensions) are required. Prefix the variables by `~` when you\n+        having exactly 2 dimensions) are required. Prefix the variables by ``~`` when you\n         want to exclude them from the plot.\n     filter_vars: {None, \"like\", \"regex\"}, optional, default=None\n         If `None` (default), interpret var_names as the real variables names. If \"like\",\n         interpret var_names as substrings of the real variables names. If \"regex\",\n         interpret var_names as regular expressions on the real variables names. A la\n-        `pandas.filter`.\n+        ``pandas.filter``.\n     transform: callable\n         Function to transform data (defaults to None i.e. the identity function)\n     coords: mapping, optional\n-        Coordinates of var_names to be plotted. Passed to `Dataset.sel`\n+        Coordinates of var_names to be plotted, passed to :meth:`xarray.Dataset.sel`\n     figsize: tuple\n         Figure size. If None it will be defined automatically.\n     textsize: float\n         Text size scaling factor for labels, titles and lines. If None it will be autoscaled based\n         on figsize.\n     kind: str\n-        Type of plot to display (scatter, kde or hexbin)\n+        Type of plot to display (\"scatter\", \"kde\" or \"hexbin\")\n     gridsize: int or (int, int), optional.\n-        The number of hexagons in the x-direction. Ignored when hexbin is False. See `plt.hexbin`\n-        for details\n+        The number of hexagons in the x-direction. Ignored when hexbin is False.\n+        See :func:`matplotlib.pyplot.hexbin` for details.\n     contour: bool\n         If True plot the 2D KDE using contours, otherwise plot a smooth 2D KDE. Defaults to True.\n     fill_last: bool\n@@ -73,10 +77,11 @@\n         Tuple containing (ax_joint, ax_hist_x, ax_hist_y). If None, a new figure and axes\n         will be created. Matplotlib axes or bokeh figures.\n     backend: str, optional\n-        Select plotting backend {\"matplotlib\",\"bokeh\"}. Default \"matplotlib\".\n+        Select plotting backend {\"matplotlib\",\"bokeh\"}. Defaults to \"matplotlib\".\n     backend_kwargs: bool, optional\n-        These are kwargs specific to the backend being used. For additional documentation\n-        check the plotting method of the backend.\n+        These are kwargs specific to the backend being used, passed to\n+        :func:`matplotlib.pyplot.figure` or\n+        :func:`bokeh.plotting.figure`.\n     show: bool, optional\n         Call backend show function.\n \n@@ -87,6 +92,10 @@\n         ax_hist_x: x (top) distribution\n         ax_hist_y: y (right) distribution\n \n+    See Also\n+    --------\n+    plot_pair : Plot a scatter, kde and/or hexbin matrix with (optional) marginals on the diagonal.\n+\n     Examples\n     --------\n     Scatter Joint plot\n", "issue": "Add docs references to plot_joint docstring\nAdd links to the related functions and classes to all the places where they are mentioned in the [plot_joint](https://arviz-devs.github.io/arviz/api/generated/arviz.plot_joint.html) docstring.\r\n\r\n## Sample PR:\r\nYou can see https://github.com/arviz-devs/arviz/pull/1816 for the function, `plot_autocorr`. \r\n\r\n## Source File\r\nSource file: https://github.com/arviz-devs/arviz/blob/main/arviz/plots/jointplot.py\r\n\r\n## How to add links\r\nAdd the links in the docstring of doc. You can also check the docstring by going to the `[source]`. \r\n\r\n* Add links to the ArviZ functions and classes using [Cross-referencing with Sphinx](https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html).\r\n* Add links to the xarray functions and classes using [Intersphinx](https://docs.readthedocs.io/en/stable/guides/intersphinx.html).\r\n* Add the rest of the external links using this [syntax](https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html#links-to-external-web-pages).\r\n\r\n## `backend_kwargs`, `marginal_kwargs` and `joint_kwargs`\r\nFor adding `backend_kwargs` as they have been added in #1816, see [Adding backend_kwargs guide](https://github.com/arviz-devs/arviz/wiki/ArviZ-Hacktoberfest-2021#adding-backend_kwargs). Follow the same process for `marginal_kwargs ` and `joint_kwargs`.\r\n\r\n## See also section\r\nAdd the following functions in the \"See also\" section:\r\n1. [plot_pair](https://arviz-devs.github.io/arviz/api/generated/arviz.plot_pair.html)\r\n\r\nSee [Adding \"see also\" section](https://github.com/arviz-devs/arviz/wiki/ArviZ-Hacktoberfest-2021#adding-see-also-section) for more details. \r\n\r\n## Checking the preview of docs\r\nFor checking the preview of docs, you don't need t set up the project on your local machine. Just follow the [checking the preview guide](https://github.com/arviz-devs/arviz/wiki/ArviZ-Hacktoberfest-2021#how-to-check-the-preview-of-docs). \n", "before_files": [{"content": "\"\"\"Joint scatter plot of two variables.\"\"\"\nimport warnings\n\nfrom ..data import convert_to_dataset\nfrom ..sel_utils import xarray_var_iter\nfrom ..rcparams import rcParams\nfrom ..utils import _var_names, get_coords\nfrom .plot_utils import get_plotting_function\n\n\ndef plot_joint(\n    data,\n    group=\"posterior\",\n    var_names=None,\n    filter_vars=None,\n    transform=None,\n    coords=None,\n    figsize=None,\n    textsize=None,\n    kind=\"scatter\",\n    gridsize=\"auto\",\n    contour=True,\n    fill_last=True,\n    joint_kwargs=None,\n    marginal_kwargs=None,\n    ax=None,\n    backend=None,\n    backend_kwargs=None,\n    show=None,\n):\n    \"\"\"\n    Plot a scatter or hexbin of two variables with their respective marginals distributions.\n\n    Parameters\n    ----------\n    data: obj\n        Any object that can be converted to an az.InferenceData object\n        Refer to documentation of az.convert_to_dataset for details\n    group: str, optional\n        Specifies which InferenceData group should be plotted. Defaults to \u2018posterior\u2019.\n    var_names: str or iterable of str\n        Variables to be plotted. Iterable of two variables or one variable (with subset\n        having exactly 2 dimensions) are required. Prefix the variables by `~` when you\n        want to exclude them from the plot.\n    filter_vars: {None, \"like\", \"regex\"}, optional, default=None\n        If `None` (default), interpret var_names as the real variables names. If \"like\",\n        interpret var_names as substrings of the real variables names. If \"regex\",\n        interpret var_names as regular expressions on the real variables names. A la\n        `pandas.filter`.\n    transform: callable\n        Function to transform data (defaults to None i.e. the identity function)\n    coords: mapping, optional\n        Coordinates of var_names to be plotted. Passed to `Dataset.sel`\n    figsize: tuple\n        Figure size. If None it will be defined automatically.\n    textsize: float\n        Text size scaling factor for labels, titles and lines. If None it will be autoscaled based\n        on figsize.\n    kind: str\n        Type of plot to display (scatter, kde or hexbin)\n    gridsize: int or (int, int), optional.\n        The number of hexagons in the x-direction. Ignored when hexbin is False. See `plt.hexbin`\n        for details\n    contour: bool\n        If True plot the 2D KDE using contours, otherwise plot a smooth 2D KDE. Defaults to True.\n    fill_last: bool\n        If True fill the last contour of the 2D KDE plot. Defaults to True.\n    joint_kwargs: dicts, optional\n        Additional keywords modifying the join distribution (central subplot)\n    marginal_kwargs: dicts, optional\n        Additional keywords modifying the marginals distributions (top and right subplot)\n    ax: tuple of axes, optional\n        Tuple containing (ax_joint, ax_hist_x, ax_hist_y). If None, a new figure and axes\n        will be created. Matplotlib axes or bokeh figures.\n    backend: str, optional\n        Select plotting backend {\"matplotlib\",\"bokeh\"}. Default \"matplotlib\".\n    backend_kwargs: bool, optional\n        These are kwargs specific to the backend being used. For additional documentation\n        check the plotting method of the backend.\n    show: bool, optional\n        Call backend show function.\n\n    Returns\n    -------\n    axes: matplotlib axes or bokeh figures\n        ax_joint: joint (central) distribution\n        ax_hist_x: x (top) distribution\n        ax_hist_y: y (right) distribution\n\n    Examples\n    --------\n    Scatter Joint plot\n\n    .. plot::\n        :context: close-figs\n\n        >>> import arviz as az\n        >>> data = az.load_arviz_data('non_centered_eight')\n        >>> az.plot_joint(data,\n        >>>             var_names=['theta'],\n        >>>             coords={'school': ['Choate', 'Phillips Andover']},\n        >>>             kind='scatter',\n        >>>             figsize=(6, 6))\n\n    Hexbin Joint plot\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_joint(data,\n        >>>             var_names=['theta'],\n        >>>             coords={'school': ['Choate', 'Phillips Andover']},\n        >>>             kind='hexbin',\n        >>>             figsize=(6, 6))\n\n    KDE Joint plot\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_joint(data,\n        >>>                 var_names=['theta'],\n        >>>                 coords={'school': ['Choate', 'Phillips Andover']},\n        >>>                 kind='kde',\n        >>>                 figsize=(6, 6))\n\n    Overlaid plots:\n\n    .. plot::\n        :context: close-figs\n\n        >>> data2 = az.load_arviz_data(\"centered_eight\")\n        >>> kde_kwargs = {\"contourf_kwargs\": {\"alpha\": 0}, \"contour_kwargs\": {\"colors\": \"k\"}}\n        >>> ax = az.plot_joint(\n        ...     data, var_names=(\"mu\", \"tau\"), kind=\"kde\", fill_last=False,\n        ...     joint_kwargs=kde_kwargs, marginal_kwargs={\"color\": \"k\"}\n        ... )\n        >>> kde_kwargs[\"contour_kwargs\"][\"colors\"] = \"r\"\n        >>> az.plot_joint(\n        ...     data2, var_names=(\"mu\", \"tau\"), kind=\"kde\", fill_last=False,\n        ...     joint_kwargs=kde_kwargs, marginal_kwargs={\"color\": \"r\"}, ax=ax\n        ... )\n\n    \"\"\"\n    warnings.warn(\"plot_joint will be deprecated. Please use plot_pair instead.\")\n\n    valid_kinds = [\"scatter\", \"kde\", \"hexbin\"]\n    if kind not in valid_kinds:\n        raise ValueError(\n            (\"Plot type {} not recognized.\" \"Plot type must be in {}\").format(kind, valid_kinds)\n        )\n\n    data = convert_to_dataset(data, group=group)\n\n    if transform is not None:\n        data = transform(data)\n\n    if coords is None:\n        coords = {}\n\n    var_names = _var_names(var_names, data, filter_vars)\n\n    plotters = list(xarray_var_iter(get_coords(data, coords), var_names=var_names, combined=True))\n\n    if len(plotters) != 2:\n        raise Exception(f\"Number of variables to be plotted must 2 (you supplied {len(plotters)})\")\n\n    plot_joint_kwargs = dict(\n        ax=ax,\n        figsize=figsize,\n        plotters=plotters,\n        kind=kind,\n        contour=contour,\n        fill_last=fill_last,\n        joint_kwargs=joint_kwargs,\n        gridsize=gridsize,\n        textsize=textsize,\n        marginal_kwargs=marginal_kwargs,\n        backend_kwargs=backend_kwargs,\n        show=show,\n    )\n\n    if backend is None:\n        backend = rcParams[\"plot.backend\"]\n    backend = backend.lower()\n\n    # TODO: Add backend kwargs\n    plot = get_plotting_function(\"plot_joint\", \"jointplot\", backend)\n    axes = plot(**plot_joint_kwargs)\n    return axes\n", "path": "arviz/plots/jointplot.py"}], "after_files": [{"content": "\"\"\"Joint scatter plot of two variables.\"\"\"\nimport warnings\n\nfrom ..data import convert_to_dataset\nfrom ..sel_utils import xarray_var_iter\nfrom ..rcparams import rcParams\nfrom ..utils import _var_names, get_coords\nfrom .plot_utils import get_plotting_function\n\n\ndef plot_joint(\n    data,\n    group=\"posterior\",\n    var_names=None,\n    filter_vars=None,\n    transform=None,\n    coords=None,\n    figsize=None,\n    textsize=None,\n    kind=\"scatter\",\n    gridsize=\"auto\",\n    contour=True,\n    fill_last=True,\n    joint_kwargs=None,\n    marginal_kwargs=None,\n    ax=None,\n    backend=None,\n    backend_kwargs=None,\n    show=None,\n):\n    \"\"\"\n    Plot a scatter or hexbin of two variables with their respective marginals distributions.\n\n    .. deprecated:: 0.9.0\n        Use :func:`arviz.plot_pair` instead.\n\n    Parameters\n    ----------\n    data: obj\n        Any object that can be converted to an :class:`arviz.InferenceData` object\n        Refer to documentation of :func:`arviz.convert_to_dataset` for details.\n    group: str, optional\n        Specifies which :class:`arviz.InferenceData` group should be plotted.\n        Defaults to \"posterior\".\n    var_names: str or iterable of str\n        Variables to be plotted. Iterable of two variables or one variable (with subset\n        having exactly 2 dimensions) are required. Prefix the variables by ``~`` when you\n        want to exclude them from the plot.\n    filter_vars: {None, \"like\", \"regex\"}, optional, default=None\n        If `None` (default), interpret var_names as the real variables names. If \"like\",\n        interpret var_names as substrings of the real variables names. If \"regex\",\n        interpret var_names as regular expressions on the real variables names. A la\n        ``pandas.filter``.\n    transform: callable\n        Function to transform data (defaults to None i.e. the identity function)\n    coords: mapping, optional\n        Coordinates of var_names to be plotted, passed to :meth:`xarray.Dataset.sel`\n    figsize: tuple\n        Figure size. If None it will be defined automatically.\n    textsize: float\n        Text size scaling factor for labels, titles and lines. If None it will be autoscaled based\n        on figsize.\n    kind: str\n        Type of plot to display (\"scatter\", \"kde\" or \"hexbin\")\n    gridsize: int or (int, int), optional.\n        The number of hexagons in the x-direction. Ignored when hexbin is False.\n        See :func:`matplotlib.pyplot.hexbin` for details.\n    contour: bool\n        If True plot the 2D KDE using contours, otherwise plot a smooth 2D KDE. Defaults to True.\n    fill_last: bool\n        If True fill the last contour of the 2D KDE plot. Defaults to True.\n    joint_kwargs: dicts, optional\n        Additional keywords modifying the join distribution (central subplot)\n    marginal_kwargs: dicts, optional\n        Additional keywords modifying the marginals distributions (top and right subplot)\n    ax: tuple of axes, optional\n        Tuple containing (ax_joint, ax_hist_x, ax_hist_y). If None, a new figure and axes\n        will be created. Matplotlib axes or bokeh figures.\n    backend: str, optional\n        Select plotting backend {\"matplotlib\",\"bokeh\"}. Defaults to \"matplotlib\".\n    backend_kwargs: bool, optional\n        These are kwargs specific to the backend being used, passed to\n        :func:`matplotlib.pyplot.figure` or\n        :func:`bokeh.plotting.figure`.\n    show: bool, optional\n        Call backend show function.\n\n    Returns\n    -------\n    axes: matplotlib axes or bokeh figures\n        ax_joint: joint (central) distribution\n        ax_hist_x: x (top) distribution\n        ax_hist_y: y (right) distribution\n\n    See Also\n    --------\n    plot_pair : Plot a scatter, kde and/or hexbin matrix with (optional) marginals on the diagonal.\n\n    Examples\n    --------\n    Scatter Joint plot\n\n    .. plot::\n        :context: close-figs\n\n        >>> import arviz as az\n        >>> data = az.load_arviz_data('non_centered_eight')\n        >>> az.plot_joint(data,\n        >>>             var_names=['theta'],\n        >>>             coords={'school': ['Choate', 'Phillips Andover']},\n        >>>             kind='scatter',\n        >>>             figsize=(6, 6))\n\n    Hexbin Joint plot\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_joint(data,\n        >>>             var_names=['theta'],\n        >>>             coords={'school': ['Choate', 'Phillips Andover']},\n        >>>             kind='hexbin',\n        >>>             figsize=(6, 6))\n\n    KDE Joint plot\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_joint(data,\n        >>>                 var_names=['theta'],\n        >>>                 coords={'school': ['Choate', 'Phillips Andover']},\n        >>>                 kind='kde',\n        >>>                 figsize=(6, 6))\n\n    Overlaid plots:\n\n    .. plot::\n        :context: close-figs\n\n        >>> data2 = az.load_arviz_data(\"centered_eight\")\n        >>> kde_kwargs = {\"contourf_kwargs\": {\"alpha\": 0}, \"contour_kwargs\": {\"colors\": \"k\"}}\n        >>> ax = az.plot_joint(\n        ...     data, var_names=(\"mu\", \"tau\"), kind=\"kde\", fill_last=False,\n        ...     joint_kwargs=kde_kwargs, marginal_kwargs={\"color\": \"k\"}\n        ... )\n        >>> kde_kwargs[\"contour_kwargs\"][\"colors\"] = \"r\"\n        >>> az.plot_joint(\n        ...     data2, var_names=(\"mu\", \"tau\"), kind=\"kde\", fill_last=False,\n        ...     joint_kwargs=kde_kwargs, marginal_kwargs={\"color\": \"r\"}, ax=ax\n        ... )\n\n    \"\"\"\n    warnings.warn(\"plot_joint will be deprecated. Please use plot_pair instead.\")\n\n    valid_kinds = [\"scatter\", \"kde\", \"hexbin\"]\n    if kind not in valid_kinds:\n        raise ValueError(\n            (\"Plot type {} not recognized.\" \"Plot type must be in {}\").format(kind, valid_kinds)\n        )\n\n    data = convert_to_dataset(data, group=group)\n\n    if transform is not None:\n        data = transform(data)\n\n    if coords is None:\n        coords = {}\n\n    var_names = _var_names(var_names, data, filter_vars)\n\n    plotters = list(xarray_var_iter(get_coords(data, coords), var_names=var_names, combined=True))\n\n    if len(plotters) != 2:\n        raise Exception(f\"Number of variables to be plotted must 2 (you supplied {len(plotters)})\")\n\n    plot_joint_kwargs = dict(\n        ax=ax,\n        figsize=figsize,\n        plotters=plotters,\n        kind=kind,\n        contour=contour,\n        fill_last=fill_last,\n        joint_kwargs=joint_kwargs,\n        gridsize=gridsize,\n        textsize=textsize,\n        marginal_kwargs=marginal_kwargs,\n        backend_kwargs=backend_kwargs,\n        show=show,\n    )\n\n    if backend is None:\n        backend = rcParams[\"plot.backend\"]\n    backend = backend.lower()\n\n    # TODO: Add backend kwargs\n    plot = get_plotting_function(\"plot_joint\", \"jointplot\", backend)\n    axes = plot(**plot_joint_kwargs)\n    return axes\n", "path": "arviz/plots/jointplot.py"}]}