We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Clarify usage of `plot_joint`
## Short Description

The description of how to use `plot_joint` is not very clear about the use and meaning of parameters.

This is partly a usage question and partly a request for documentation improvement.

## Code Example or link

Looking at the docs for `arviz.plot_joint`, I see this: 
```
var_names : Iter of 2 e.g. (var_1, var_2)
    Variables to be plotted, two variables are required.
```
But then when I look at the example, I see this:
```
az.plot_joint(data,
>>>                 var_names=['theta'],
....
```
So … what is an “iter of 2”? `['theta']` is not obviously one, and the example gives a tuple of length 2.
I think what happens in this example is that you are plotting the *single* variable `theta` across a *coordinate* of dimension 2, but this is really quite confusing, and could use a much better explanation.

arviz 0.4.1 (will update!)



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

{"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@@ -29,8 +29,9 @@\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-    var_names : Iter of 2 e.g. (var_1, var_2)\n-        Variables to be plotted, two variables are required.\n+    var_names : str or iterable of str\n+        Variables to be plotted. iter of two variables or one variable (with subset having\n+        exactly 2 dimensions) are required.\n     coords : mapping, optional\n         Coordinates of var_names to be plotted. Passed to `Dataset.sel`\n     figsize : tuple\n", "issue": "Clarify usage of `plot_joint`\n## Short Description\r\n\r\nThe description of how to use `plot_joint` is not very clear about the use and meaning of parameters.\r\n\r\nThis is partly a usage question and partly a request for documentation improvement.\r\n\r\n## Code Example or link\r\n\r\nLooking at the docs for `arviz.plot_joint`, I see this: \r\n```\r\nvar_names : Iter of 2 e.g. (var_1, var_2)\r\n    Variables to be plotted, two variables are required.\r\n```\r\nBut then when I look at the example, I see this:\r\n```\r\naz.plot_joint(data,\r\n>>>                 var_names=['theta'],\r\n....\r\n```\r\nSo \u2026 what is an \u201citer of 2\u201d? `['theta']` is not obviously one, and the example gives a tuple of length 2.\r\nI think what happens in this example is that you are plotting the *single* variable `theta` across a *coordinate* of dimension 2, but this is really quite confusing, and could use a much better explanation.\r\n\r\narviz 0.4.1 (will update!)\r\n\r\n\n", "before_files": [{"content": "\"\"\"Joint scatter plot of two variables.\"\"\"\nfrom ..data import convert_to_dataset\nfrom .plot_utils import _scale_fig_size, xarray_var_iter, get_coords, get_plotting_function\nfrom ..utils import _var_names\n\n\ndef plot_joint(\n    data,\n    var_names=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    var_names : Iter of 2 e.g. (var_1, var_2)\n        Variables to be plotted, two variables are required.\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    Overlayed 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    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=\"posterior\")\n\n    if coords is None:\n        coords = {}\n\n    var_names = _var_names(var_names, data)\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(\n            \"Number of variables to be plotted must 2 (you supplied {})\".format(len(plotters))\n        )\n\n    figsize, ax_labelsize, _, xt_labelsize, linewidth, _ = _scale_fig_size(figsize, textsize)\n\n    if joint_kwargs is None:\n        joint_kwargs = {}\n\n    if marginal_kwargs is None:\n        marginal_kwargs = {}\n    marginal_kwargs.setdefault(\"plot_kwargs\", {})\n    marginal_kwargs[\"plot_kwargs\"][\"linewidth\"] = linewidth\n\n    plot_joint_kwargs = dict(\n        ax=ax,\n        figsize=figsize,\n        plotters=plotters,\n        ax_labelsize=ax_labelsize,\n        xt_labelsize=xt_labelsize,\n        kind=kind,\n        contour=contour,\n        fill_last=fill_last,\n        joint_kwargs=joint_kwargs,\n        gridsize=gridsize,\n        marginal_kwargs=marginal_kwargs,\n        backend_kwargs=backend_kwargs,\n        show=show,\n    )\n\n    if backend == \"bokeh\":\n\n        plot_joint_kwargs.pop(\"ax_labelsize\")\n        plot_joint_kwargs[\"marginal_kwargs\"][\"plot_kwargs\"][\"line_width\"] = plot_joint_kwargs[\n            \"marginal_kwargs\"\n        ][\"plot_kwargs\"].pop(\"linewidth\")\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.\"\"\"\nfrom ..data import convert_to_dataset\nfrom .plot_utils import _scale_fig_size, xarray_var_iter, get_coords, get_plotting_function\nfrom ..utils import _var_names\n\n\ndef plot_joint(\n    data,\n    var_names=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    var_names : str or iterable of str\n        Variables to be plotted. iter of two variables or one variable (with subset having\n        exactly 2 dimensions) are required.\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    Overlayed 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    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=\"posterior\")\n\n    if coords is None:\n        coords = {}\n\n    var_names = _var_names(var_names, data)\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(\n            \"Number of variables to be plotted must 2 (you supplied {})\".format(len(plotters))\n        )\n\n    figsize, ax_labelsize, _, xt_labelsize, linewidth, _ = _scale_fig_size(figsize, textsize)\n\n    if joint_kwargs is None:\n        joint_kwargs = {}\n\n    if marginal_kwargs is None:\n        marginal_kwargs = {}\n    marginal_kwargs.setdefault(\"plot_kwargs\", {})\n    marginal_kwargs[\"plot_kwargs\"][\"linewidth\"] = linewidth\n\n    plot_joint_kwargs = dict(\n        ax=ax,\n        figsize=figsize,\n        plotters=plotters,\n        ax_labelsize=ax_labelsize,\n        xt_labelsize=xt_labelsize,\n        kind=kind,\n        contour=contour,\n        fill_last=fill_last,\n        joint_kwargs=joint_kwargs,\n        gridsize=gridsize,\n        marginal_kwargs=marginal_kwargs,\n        backend_kwargs=backend_kwargs,\n        show=show,\n    )\n\n    if backend == \"bokeh\":\n\n        plot_joint_kwargs.pop(\"ax_labelsize\")\n        plot_joint_kwargs[\"marginal_kwargs\"][\"plot_kwargs\"][\"line_width\"] = plot_joint_kwargs[\n            \"marginal_kwargs\"\n        ][\"plot_kwargs\"].pop(\"linewidth\")\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"}]}