We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add an examples of coords argument in documentation
**Describe the bug**
There's this fancy coords argument but not a great explanation on how to use it in the code examples below
https://arviz-devs.github.io/arviz/api/generated/arviz.plot_posterior.html

![image](https://user-images.githubusercontent.com/7213793/97931298-2adaad80-1d22-11eb-9e97-3e46ed2f9650.png)


**To Reproduce**
Look at the doc, notice the lack of coords documentation in the code example

**Expected behavior**
Theres an example in the code below


--- 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/posteriorplot.py`
Content:
```
1 """Plot posterior densities."""
2 from ..data import convert_to_dataset
3 from ..rcparams import rcParams
4 from ..utils import _var_names, get_coords
5 from .plot_utils import default_grid, filter_plotters_list, get_plotting_function, xarray_var_iter
6 
7 
8 def plot_posterior(
9     data,
10     var_names=None,
11     filter_vars=None,
12     transform=None,
13     coords=None,
14     grid=None,
15     figsize=None,
16     textsize=None,
17     hdi_prob=None,
18     multimodal=False,
19     skipna=False,
20     round_to=None,
21     point_estimate="auto",
22     group="posterior",
23     rope=None,
24     ref_val=None,
25     kind="kde",
26     bw="default",
27     circular=False,
28     bins=None,
29     ax=None,
30     backend=None,
31     backend_kwargs=None,
32     show=None,
33     **kwargs
34 ):
35     """Plot Posterior densities in the style of John K. Kruschke's book.
36 
37     Parameters
38     ----------
39     data: obj
40         Any object that can be converted to an az.InferenceData object
41         Refer to documentation of az.convert_to_dataset for details
42     var_names: list of variable names
43         Variables to be plotted, two variables are required. Prefix the variables by `~`
44         when you 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     grid : tuple
55         Number of rows and columns. Defaults to None, the rows and columns are
56         automatically inferred.
57     figsize: tuple
58         Figure size. If None it will be defined automatically.
59     textsize: float
60         Text size scaling factor for labels, titles and lines. If None it will be autoscaled based
61         on figsize.
62     hdi_prob: float, optional
63         Plots highest density interval for chosen percentage of density.
64         Use 'hide' to hide the highest density interval. Defaults to 0.94.
65     multimodal: bool
66         If true (default) it may compute more than one credible interval if the distribution is
67         multimodal and the modes are well separated.
68     skipna : bool
69         If true ignores nan values when computing the hdi and point estimates. Defaults to false.
70     round_to: int, optional
71         Controls formatting of floats. Defaults to 2 or the integer part, whichever is bigger.
72     point_estimate: Optional[str]
73         Plot point estimate per variable. Values should be 'mean', 'median', 'mode' or None.
74         Defaults to 'auto' i.e. it falls back to default set in rcParams.
75     group: str, optional
76         Specifies which InferenceData group should be plotted. Defaults to ‘posterior’.
77     rope: tuple or dictionary of tuples
78         Lower and upper values of the Region Of Practical Equivalence. If a list is provided, its
79         length should match the number of variables.
80     ref_val: float or dictionary of floats
81         display the percentage below and above the values in ref_val. Must be None (default),
82         a constant, a list or a dictionary like see an example below. If a list is provided, its
83         length should match the number of variables.
84     kind: str
85         Type of plot to display (kde or hist) For discrete variables this argument is ignored and
86         a histogram is always used.
87     bw: float or str, optional
88         If numeric, indicates the bandwidth and must be positive.
89         If str, indicates the method to estimate the bandwidth and must be
90         one of "scott", "silverman", "isj" or "experimental" when `circular` is False
91         and "taylor" (for now) when `circular` is True.
92         Defaults to "default" which means "experimental" when variable is not circular
93         and "taylor" when it is. Only works if `kind == kde`.
94     circular: bool, optional
95         If True, it interprets the values passed are from a circular variable measured in radians
96         and a circular KDE is used. Only valid for 1D KDE. Defaults to False.
97         Only works if `kind == kde`.
98     bins: integer or sequence or 'auto', optional
99         Controls the number of bins, accepts the same keywords `matplotlib.hist()` does. Only works
100         if `kind == hist`. If None (default) it will use `auto` for continuous variables and
101         `range(xmin, xmax + 1)` for discrete variables.
102     ax: numpy array-like of matplotlib axes or bokeh figures, optional
103         A 2D array of locations into which to plot the densities. If not supplied, Arviz will create
104         its own array of plot areas (and return it).
105     backend: str, optional
106         Select plotting backend {"matplotlib","bokeh"}. Default "matplotlib".
107     backend_kwargs: bool, optional
108         These are kwargs specific to the backend being used. For additional documentation
109         check the plotting method of the backend.
110     show: bool, optional
111         Call backend show function.
112     **kwargs
113         Passed as-is to plt.hist() or plt.plot() function depending on the value of `kind`.
114 
115     Returns
116     -------
117     axes: matplotlib axes or bokeh figures
118 
119     Examples
120     --------
121     Show a default kernel density plot following style of John Kruschke
122 
123     .. plot::
124         :context: close-figs
125 
126         >>> import arviz as az
127         >>> data = az.load_arviz_data('centered_eight')
128         >>> az.plot_posterior(data)
129 
130     Plot subset variables by specifying variable name exactly
131 
132     .. plot::
133         :context: close-figs
134 
135         >>> az.plot_posterior(data, var_names=['mu'])
136 
137     Plot Region of Practical Equivalence (rope) and select variables with regular expressions
138 
139     .. plot::
140         :context: close-figs
141 
142         >>> az.plot_posterior(data, var_names=['mu', '^the'], filter_vars="regex", rope=(-1, 1))
143 
144     Plot Region of Practical Equivalence for selected distributions
145 
146     .. plot::
147         :context: close-figs
148 
149         >>> rope = {'mu': [{'rope': (-2, 2)}], 'theta': [{'school': 'Choate', 'rope': (2, 4)}]}
150         >>> az.plot_posterior(data, var_names=['mu', 'theta'], rope=rope)
151 
152 
153     Add reference lines
154 
155     .. plot::
156         :context: close-figs
157 
158         >>> az.plot_posterior(data, var_names=['mu', 'theta'], ref_val=0)
159 
160     Show point estimate of distribution
161 
162     .. plot::
163         :context: close-figs
164 
165         >>> az.plot_posterior(data, var_names=['mu', 'theta'], point_estimate='mode')
166 
167     Show reference values using variable names and coordinates
168 
169     .. plot::
170         :context: close-figs
171 
172         >>> az.plot_posterior(data, ref_val= {"theta": [{"school": "Deerfield", "ref_val": 4},
173         ...                                             {"school": "Choate", "ref_val": 3}]})
174 
175     Show reference values using a list
176 
177     .. plot::
178         :context: close-figs
179 
180         >>> az.plot_posterior(data, ref_val=[1] + [5] * 8 + [1])
181 
182 
183     Plot posterior as a histogram
184 
185     .. plot::
186         :context: close-figs
187 
188         >>> az.plot_posterior(data, var_names=['mu'], kind='hist')
189 
190     Change size of highest density interval
191 
192     .. plot::
193         :context: close-figs
194 
195         >>> az.plot_posterior(data, var_names=['mu'], hdi_prob=.75)
196     """
197     data = convert_to_dataset(data, group=group)
198     if transform is not None:
199         data = transform(data)
200     var_names = _var_names(var_names, data, filter_vars)
201 
202     if coords is None:
203         coords = {}
204 
205     if hdi_prob is None:
206         hdi_prob = rcParams["stats.hdi_prob"]
207     elif hdi_prob not in (None, "hide"):
208         if not 1 >= hdi_prob > 0:
209             raise ValueError("The value of hdi_prob should be in the interval (0, 1]")
210 
211     if point_estimate == "auto":
212         point_estimate = rcParams["plot.point_estimate"]
213     elif point_estimate not in {"mean", "median", "mode", None}:
214         raise ValueError("The value of point_estimate must be either mean, median, mode or None.")
215 
216     plotters = filter_plotters_list(
217         list(xarray_var_iter(get_coords(data, coords), var_names=var_names, combined=True)),
218         "plot_posterior",
219     )
220     length_plotters = len(plotters)
221     rows, cols = default_grid(length_plotters, grid=grid)
222 
223     posteriorplot_kwargs = dict(
224         ax=ax,
225         length_plotters=length_plotters,
226         rows=rows,
227         cols=cols,
228         figsize=figsize,
229         plotters=plotters,
230         bw=bw,
231         circular=circular,
232         bins=bins,
233         kind=kind,
234         point_estimate=point_estimate,
235         round_to=round_to,
236         hdi_prob=hdi_prob,
237         multimodal=multimodal,
238         skipna=skipna,
239         textsize=textsize,
240         ref_val=ref_val,
241         rope=rope,
242         kwargs=kwargs,
243         backend_kwargs=backend_kwargs,
244         show=show,
245     )
246 
247     if backend is None:
248         backend = rcParams["plot.backend"]
249     backend = backend.lower()
250 
251     # TODO: Add backend kwargs
252     plot = get_plotting_function("plot_posterior", "posteriorplot", backend)
253     ax = plot(**posteriorplot_kwargs)
254     return ax
255
```
--- 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/posteriorplot.py b/arviz/plots/posteriorplot.py
--- a/arviz/plots/posteriorplot.py
+++ b/arviz/plots/posteriorplot.py
@@ -149,6 +149,13 @@
         >>> rope = {'mu': [{'rope': (-2, 2)}], 'theta': [{'school': 'Choate', 'rope': (2, 4)}]}
         >>> az.plot_posterior(data, var_names=['mu', 'theta'], rope=rope)
 
+    Using `coords` argument to plot only a subset of data
+
+    .. plot::
+        :context: close-figs
+
+        >>> coords = {"school": ["Choate","Phillips Exeter"]}
+        >>> az.plot_posterior(data, var_names=["mu", "theta"], coords=coords)
 
     Add reference lines

{"golden_diff": "diff --git a/arviz/plots/posteriorplot.py b/arviz/plots/posteriorplot.py\n--- a/arviz/plots/posteriorplot.py\n+++ b/arviz/plots/posteriorplot.py\n@@ -149,6 +149,13 @@\n         >>> rope = {'mu': [{'rope': (-2, 2)}], 'theta': [{'school': 'Choate', 'rope': (2, 4)}]}\n         >>> az.plot_posterior(data, var_names=['mu', 'theta'], rope=rope)\n \n+    Using `coords` argument to plot only a subset of data\n+\n+    .. plot::\n+        :context: close-figs\n+\n+        >>> coords = {\"school\": [\"Choate\",\"Phillips Exeter\"]}\n+        >>> az.plot_posterior(data, var_names=[\"mu\", \"theta\"], coords=coords)\n \n     Add reference lines\n", "issue": "Add an examples of coords argument in documentation\n**Describe the bug**\r\nThere's this fancy coords argument but not a great explanation on how to use it in the code examples below\r\nhttps://arviz-devs.github.io/arviz/api/generated/arviz.plot_posterior.html\r\n\r\n![image](https://user-images.githubusercontent.com/7213793/97931298-2adaad80-1d22-11eb-9e97-3e46ed2f9650.png)\r\n\r\n\r\n**To Reproduce**\r\nLook at the doc, notice the lack of coords documentation in the code example\r\n\r\n**Expected behavior**\r\nTheres an example in the code below\r\n\n", "before_files": [{"content": "\"\"\"Plot posterior densities.\"\"\"\nfrom ..data import convert_to_dataset\nfrom ..rcparams import rcParams\nfrom ..utils import _var_names, get_coords\nfrom .plot_utils import default_grid, filter_plotters_list, get_plotting_function, xarray_var_iter\n\n\ndef plot_posterior(\n    data,\n    var_names=None,\n    filter_vars=None,\n    transform=None,\n    coords=None,\n    grid=None,\n    figsize=None,\n    textsize=None,\n    hdi_prob=None,\n    multimodal=False,\n    skipna=False,\n    round_to=None,\n    point_estimate=\"auto\",\n    group=\"posterior\",\n    rope=None,\n    ref_val=None,\n    kind=\"kde\",\n    bw=\"default\",\n    circular=False,\n    bins=None,\n    ax=None,\n    backend=None,\n    backend_kwargs=None,\n    show=None,\n    **kwargs\n):\n    \"\"\"Plot Posterior densities in the style of John K. Kruschke's book.\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: list of variable names\n        Variables to be plotted, two variables are required. Prefix the variables by `~`\n        when you 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    grid : tuple\n        Number of rows and columns. Defaults to None, the rows and columns are\n        automatically inferred.\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    hdi_prob: float, optional\n        Plots highest density interval for chosen percentage of density.\n        Use 'hide' to hide the highest density interval. Defaults to 0.94.\n    multimodal: bool\n        If true (default) it may compute more than one credible interval if the distribution is\n        multimodal and the modes are well separated.\n    skipna : bool\n        If true ignores nan values when computing the hdi and point estimates. Defaults to false.\n    round_to: int, optional\n        Controls formatting of floats. Defaults to 2 or the integer part, whichever is bigger.\n    point_estimate: Optional[str]\n        Plot point estimate per variable. Values should be 'mean', 'median', 'mode' or None.\n        Defaults to 'auto' i.e. it falls back to default set in rcParams.\n    group: str, optional\n        Specifies which InferenceData group should be plotted. Defaults to \u2018posterior\u2019.\n    rope: tuple or dictionary of tuples\n        Lower and upper values of the Region Of Practical Equivalence. If a list is provided, its\n        length should match the number of variables.\n    ref_val: float or dictionary of floats\n        display the percentage below and above the values in ref_val. Must be None (default),\n        a constant, a list or a dictionary like see an example below. If a list is provided, its\n        length should match the number of variables.\n    kind: str\n        Type of plot to display (kde or hist) For discrete variables this argument is ignored and\n        a histogram is always used.\n    bw: float or str, optional\n        If numeric, indicates the bandwidth and must be positive.\n        If str, indicates the method to estimate the bandwidth and must be\n        one of \"scott\", \"silverman\", \"isj\" or \"experimental\" when `circular` is False\n        and \"taylor\" (for now) when `circular` is True.\n        Defaults to \"default\" which means \"experimental\" when variable is not circular\n        and \"taylor\" when it is. Only works if `kind == kde`.\n    circular: bool, optional\n        If True, it interprets the values passed are from a circular variable measured in radians\n        and a circular KDE is used. Only valid for 1D KDE. Defaults to False.\n        Only works if `kind == kde`.\n    bins: integer or sequence or 'auto', optional\n        Controls the number of bins, accepts the same keywords `matplotlib.hist()` does. Only works\n        if `kind == hist`. If None (default) it will use `auto` for continuous variables and\n        `range(xmin, xmax + 1)` for discrete variables.\n    ax: numpy array-like of matplotlib axes or bokeh figures, optional\n        A 2D array of locations into which to plot the densities. If not supplied, Arviz will create\n        its own array of plot areas (and return it).\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    **kwargs\n        Passed as-is to plt.hist() or plt.plot() function depending on the value of `kind`.\n\n    Returns\n    -------\n    axes: matplotlib axes or bokeh figures\n\n    Examples\n    --------\n    Show a default kernel density plot following style of John Kruschke\n\n    .. plot::\n        :context: close-figs\n\n        >>> import arviz as az\n        >>> data = az.load_arviz_data('centered_eight')\n        >>> az.plot_posterior(data)\n\n    Plot subset variables by specifying variable name exactly\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu'])\n\n    Plot Region of Practical Equivalence (rope) and select variables with regular expressions\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu', '^the'], filter_vars=\"regex\", rope=(-1, 1))\n\n    Plot Region of Practical Equivalence for selected distributions\n\n    .. plot::\n        :context: close-figs\n\n        >>> rope = {'mu': [{'rope': (-2, 2)}], 'theta': [{'school': 'Choate', 'rope': (2, 4)}]}\n        >>> az.plot_posterior(data, var_names=['mu', 'theta'], rope=rope)\n\n\n    Add reference lines\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu', 'theta'], ref_val=0)\n\n    Show point estimate of distribution\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu', 'theta'], point_estimate='mode')\n\n    Show reference values using variable names and coordinates\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, ref_val= {\"theta\": [{\"school\": \"Deerfield\", \"ref_val\": 4},\n        ...                                             {\"school\": \"Choate\", \"ref_val\": 3}]})\n\n    Show reference values using a list\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, ref_val=[1] + [5] * 8 + [1])\n\n\n    Plot posterior as a histogram\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu'], kind='hist')\n\n    Change size of highest density interval\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu'], hdi_prob=.75)\n    \"\"\"\n    data = convert_to_dataset(data, group=group)\n    if transform is not None:\n        data = transform(data)\n    var_names = _var_names(var_names, data, filter_vars)\n\n    if coords is None:\n        coords = {}\n\n    if hdi_prob is None:\n        hdi_prob = rcParams[\"stats.hdi_prob\"]\n    elif hdi_prob not in (None, \"hide\"):\n        if not 1 >= hdi_prob > 0:\n            raise ValueError(\"The value of hdi_prob should be in the interval (0, 1]\")\n\n    if point_estimate == \"auto\":\n        point_estimate = rcParams[\"plot.point_estimate\"]\n    elif point_estimate not in {\"mean\", \"median\", \"mode\", None}:\n        raise ValueError(\"The value of point_estimate must be either mean, median, mode or None.\")\n\n    plotters = filter_plotters_list(\n        list(xarray_var_iter(get_coords(data, coords), var_names=var_names, combined=True)),\n        \"plot_posterior\",\n    )\n    length_plotters = len(plotters)\n    rows, cols = default_grid(length_plotters, grid=grid)\n\n    posteriorplot_kwargs = dict(\n        ax=ax,\n        length_plotters=length_plotters,\n        rows=rows,\n        cols=cols,\n        figsize=figsize,\n        plotters=plotters,\n        bw=bw,\n        circular=circular,\n        bins=bins,\n        kind=kind,\n        point_estimate=point_estimate,\n        round_to=round_to,\n        hdi_prob=hdi_prob,\n        multimodal=multimodal,\n        skipna=skipna,\n        textsize=textsize,\n        ref_val=ref_val,\n        rope=rope,\n        kwargs=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_posterior\", \"posteriorplot\", backend)\n    ax = plot(**posteriorplot_kwargs)\n    return ax\n", "path": "arviz/plots/posteriorplot.py"}], "after_files": [{"content": "\"\"\"Plot posterior densities.\"\"\"\nfrom ..data import convert_to_dataset\nfrom ..rcparams import rcParams\nfrom ..utils import _var_names, get_coords\nfrom .plot_utils import default_grid, filter_plotters_list, get_plotting_function, xarray_var_iter\n\n\ndef plot_posterior(\n    data,\n    var_names=None,\n    filter_vars=None,\n    transform=None,\n    coords=None,\n    grid=None,\n    figsize=None,\n    textsize=None,\n    hdi_prob=None,\n    multimodal=False,\n    skipna=False,\n    round_to=None,\n    point_estimate=\"auto\",\n    group=\"posterior\",\n    rope=None,\n    ref_val=None,\n    kind=\"kde\",\n    bw=\"default\",\n    circular=False,\n    bins=None,\n    ax=None,\n    backend=None,\n    backend_kwargs=None,\n    show=None,\n    **kwargs\n):\n    \"\"\"Plot Posterior densities in the style of John K. Kruschke's book.\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: list of variable names\n        Variables to be plotted, two variables are required. Prefix the variables by `~`\n        when you 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    grid : tuple\n        Number of rows and columns. Defaults to None, the rows and columns are\n        automatically inferred.\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    hdi_prob: float, optional\n        Plots highest density interval for chosen percentage of density.\n        Use 'hide' to hide the highest density interval. Defaults to 0.94.\n    multimodal: bool\n        If true (default) it may compute more than one credible interval if the distribution is\n        multimodal and the modes are well separated.\n    skipna : bool\n        If true ignores nan values when computing the hdi and point estimates. Defaults to false.\n    round_to: int, optional\n        Controls formatting of floats. Defaults to 2 or the integer part, whichever is bigger.\n    point_estimate: Optional[str]\n        Plot point estimate per variable. Values should be 'mean', 'median', 'mode' or None.\n        Defaults to 'auto' i.e. it falls back to default set in rcParams.\n    group: str, optional\n        Specifies which InferenceData group should be plotted. Defaults to \u2018posterior\u2019.\n    rope: tuple or dictionary of tuples\n        Lower and upper values of the Region Of Practical Equivalence. If a list is provided, its\n        length should match the number of variables.\n    ref_val: float or dictionary of floats\n        display the percentage below and above the values in ref_val. Must be None (default),\n        a constant, a list or a dictionary like see an example below. If a list is provided, its\n        length should match the number of variables.\n    kind: str\n        Type of plot to display (kde or hist) For discrete variables this argument is ignored and\n        a histogram is always used.\n    bw: float or str, optional\n        If numeric, indicates the bandwidth and must be positive.\n        If str, indicates the method to estimate the bandwidth and must be\n        one of \"scott\", \"silverman\", \"isj\" or \"experimental\" when `circular` is False\n        and \"taylor\" (for now) when `circular` is True.\n        Defaults to \"default\" which means \"experimental\" when variable is not circular\n        and \"taylor\" when it is. Only works if `kind == kde`.\n    circular: bool, optional\n        If True, it interprets the values passed are from a circular variable measured in radians\n        and a circular KDE is used. Only valid for 1D KDE. Defaults to False.\n        Only works if `kind == kde`.\n    bins: integer or sequence or 'auto', optional\n        Controls the number of bins, accepts the same keywords `matplotlib.hist()` does. Only works\n        if `kind == hist`. If None (default) it will use `auto` for continuous variables and\n        `range(xmin, xmax + 1)` for discrete variables.\n    ax: numpy array-like of matplotlib axes or bokeh figures, optional\n        A 2D array of locations into which to plot the densities. If not supplied, Arviz will create\n        its own array of plot areas (and return it).\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    **kwargs\n        Passed as-is to plt.hist() or plt.plot() function depending on the value of `kind`.\n\n    Returns\n    -------\n    axes: matplotlib axes or bokeh figures\n\n    Examples\n    --------\n    Show a default kernel density plot following style of John Kruschke\n\n    .. plot::\n        :context: close-figs\n\n        >>> import arviz as az\n        >>> data = az.load_arviz_data('centered_eight')\n        >>> az.plot_posterior(data)\n\n    Plot subset variables by specifying variable name exactly\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu'])\n\n    Plot Region of Practical Equivalence (rope) and select variables with regular expressions\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu', '^the'], filter_vars=\"regex\", rope=(-1, 1))\n\n    Plot Region of Practical Equivalence for selected distributions\n\n    .. plot::\n        :context: close-figs\n\n        >>> rope = {'mu': [{'rope': (-2, 2)}], 'theta': [{'school': 'Choate', 'rope': (2, 4)}]}\n        >>> az.plot_posterior(data, var_names=['mu', 'theta'], rope=rope)\n\n    Using `coords` argument to plot only a subset of data\n\n    .. plot::\n        :context: close-figs\n\n        >>> coords = {\"school\": [\"Choate\",\"Phillips Exeter\"]}\n        >>> az.plot_posterior(data, var_names=[\"mu\", \"theta\"], coords=coords)\n\n    Add reference lines\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu', 'theta'], ref_val=0)\n\n    Show point estimate of distribution\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu', 'theta'], point_estimate='mode')\n\n    Show reference values using variable names and coordinates\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, ref_val= {\"theta\": [{\"school\": \"Deerfield\", \"ref_val\": 4},\n        ...                                             {\"school\": \"Choate\", \"ref_val\": 3}]})\n\n    Show reference values using a list\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, ref_val=[1] + [5] * 8 + [1])\n\n\n    Plot posterior as a histogram\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu'], kind='hist')\n\n    Change size of highest density interval\n\n    .. plot::\n        :context: close-figs\n\n        >>> az.plot_posterior(data, var_names=['mu'], hdi_prob=.75)\n    \"\"\"\n    data = convert_to_dataset(data, group=group)\n    if transform is not None:\n        data = transform(data)\n    var_names = _var_names(var_names, data, filter_vars)\n\n    if coords is None:\n        coords = {}\n\n    if hdi_prob is None:\n        hdi_prob = rcParams[\"stats.hdi_prob\"]\n    elif hdi_prob not in (None, \"hide\"):\n        if not 1 >= hdi_prob > 0:\n            raise ValueError(\"The value of hdi_prob should be in the interval (0, 1]\")\n\n    if point_estimate == \"auto\":\n        point_estimate = rcParams[\"plot.point_estimate\"]\n    elif point_estimate not in {\"mean\", \"median\", \"mode\", None}:\n        raise ValueError(\"The value of point_estimate must be either mean, median, mode or None.\")\n\n    plotters = filter_plotters_list(\n        list(xarray_var_iter(get_coords(data, coords), var_names=var_names, combined=True)),\n        \"plot_posterior\",\n    )\n    length_plotters = len(plotters)\n    rows, cols = default_grid(length_plotters, grid=grid)\n\n    posteriorplot_kwargs = dict(\n        ax=ax,\n        length_plotters=length_plotters,\n        rows=rows,\n        cols=cols,\n        figsize=figsize,\n        plotters=plotters,\n        bw=bw,\n        circular=circular,\n        bins=bins,\n        kind=kind,\n        point_estimate=point_estimate,\n        round_to=round_to,\n        hdi_prob=hdi_prob,\n        multimodal=multimodal,\n        skipna=skipna,\n        textsize=textsize,\n        ref_val=ref_val,\n        rope=rope,\n        kwargs=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_posterior\", \"posteriorplot\", backend)\n    ax = plot(**posteriorplot_kwargs)\n    return ax\n", "path": "arviz/plots/posteriorplot.py"}]}