arviz 0.17.1__py3-none-any.whl → 0.19.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. arviz/__init__.py +4 -2
  2. arviz/data/__init__.py +5 -2
  3. arviz/data/base.py +102 -11
  4. arviz/data/converters.py +5 -0
  5. arviz/data/datasets.py +1 -0
  6. arviz/data/example_data/data_remote.json +10 -3
  7. arviz/data/inference_data.py +20 -22
  8. arviz/data/io_cmdstan.py +5 -3
  9. arviz/data/io_datatree.py +1 -0
  10. arviz/data/io_dict.py +5 -3
  11. arviz/data/io_emcee.py +1 -0
  12. arviz/data/io_numpyro.py +2 -1
  13. arviz/data/io_pyjags.py +1 -0
  14. arviz/data/io_pyro.py +1 -0
  15. arviz/data/utils.py +1 -0
  16. arviz/plots/__init__.py +1 -0
  17. arviz/plots/autocorrplot.py +1 -0
  18. arviz/plots/backends/bokeh/autocorrplot.py +1 -0
  19. arviz/plots/backends/bokeh/bpvplot.py +1 -0
  20. arviz/plots/backends/bokeh/compareplot.py +1 -0
  21. arviz/plots/backends/bokeh/densityplot.py +1 -0
  22. arviz/plots/backends/bokeh/distplot.py +1 -0
  23. arviz/plots/backends/bokeh/dotplot.py +1 -0
  24. arviz/plots/backends/bokeh/ecdfplot.py +2 -2
  25. arviz/plots/backends/bokeh/elpdplot.py +1 -0
  26. arviz/plots/backends/bokeh/energyplot.py +1 -0
  27. arviz/plots/backends/bokeh/hdiplot.py +1 -0
  28. arviz/plots/backends/bokeh/kdeplot.py +3 -3
  29. arviz/plots/backends/bokeh/khatplot.py +9 -3
  30. arviz/plots/backends/bokeh/lmplot.py +1 -0
  31. arviz/plots/backends/bokeh/loopitplot.py +1 -0
  32. arviz/plots/backends/bokeh/mcseplot.py +1 -0
  33. arviz/plots/backends/bokeh/pairplot.py +3 -6
  34. arviz/plots/backends/bokeh/parallelplot.py +1 -0
  35. arviz/plots/backends/bokeh/posteriorplot.py +1 -0
  36. arviz/plots/backends/bokeh/ppcplot.py +1 -0
  37. arviz/plots/backends/bokeh/rankplot.py +1 -0
  38. arviz/plots/backends/bokeh/separationplot.py +1 -0
  39. arviz/plots/backends/bokeh/traceplot.py +1 -0
  40. arviz/plots/backends/bokeh/violinplot.py +1 -0
  41. arviz/plots/backends/matplotlib/autocorrplot.py +1 -0
  42. arviz/plots/backends/matplotlib/bpvplot.py +1 -0
  43. arviz/plots/backends/matplotlib/compareplot.py +1 -0
  44. arviz/plots/backends/matplotlib/densityplot.py +1 -0
  45. arviz/plots/backends/matplotlib/distcomparisonplot.py +2 -3
  46. arviz/plots/backends/matplotlib/distplot.py +1 -0
  47. arviz/plots/backends/matplotlib/dotplot.py +1 -0
  48. arviz/plots/backends/matplotlib/ecdfplot.py +2 -2
  49. arviz/plots/backends/matplotlib/elpdplot.py +1 -0
  50. arviz/plots/backends/matplotlib/energyplot.py +1 -0
  51. arviz/plots/backends/matplotlib/essplot.py +6 -5
  52. arviz/plots/backends/matplotlib/forestplot.py +1 -0
  53. arviz/plots/backends/matplotlib/hdiplot.py +1 -0
  54. arviz/plots/backends/matplotlib/kdeplot.py +5 -3
  55. arviz/plots/backends/matplotlib/khatplot.py +8 -3
  56. arviz/plots/backends/matplotlib/lmplot.py +1 -0
  57. arviz/plots/backends/matplotlib/loopitplot.py +1 -0
  58. arviz/plots/backends/matplotlib/mcseplot.py +11 -10
  59. arviz/plots/backends/matplotlib/pairplot.py +2 -1
  60. arviz/plots/backends/matplotlib/parallelplot.py +1 -0
  61. arviz/plots/backends/matplotlib/posteriorplot.py +1 -0
  62. arviz/plots/backends/matplotlib/ppcplot.py +1 -0
  63. arviz/plots/backends/matplotlib/rankplot.py +1 -0
  64. arviz/plots/backends/matplotlib/separationplot.py +1 -0
  65. arviz/plots/backends/matplotlib/traceplot.py +2 -1
  66. arviz/plots/backends/matplotlib/tsplot.py +1 -0
  67. arviz/plots/backends/matplotlib/violinplot.py +2 -1
  68. arviz/plots/bpvplot.py +3 -2
  69. arviz/plots/compareplot.py +1 -0
  70. arviz/plots/densityplot.py +2 -1
  71. arviz/plots/distcomparisonplot.py +1 -0
  72. arviz/plots/dotplot.py +3 -2
  73. arviz/plots/ecdfplot.py +206 -89
  74. arviz/plots/elpdplot.py +1 -0
  75. arviz/plots/energyplot.py +1 -0
  76. arviz/plots/essplot.py +3 -2
  77. arviz/plots/forestplot.py +2 -1
  78. arviz/plots/hdiplot.py +3 -2
  79. arviz/plots/khatplot.py +24 -6
  80. arviz/plots/lmplot.py +1 -0
  81. arviz/plots/loopitplot.py +3 -2
  82. arviz/plots/mcseplot.py +4 -1
  83. arviz/plots/pairplot.py +1 -0
  84. arviz/plots/parallelplot.py +1 -0
  85. arviz/plots/plot_utils.py +3 -4
  86. arviz/plots/posteriorplot.py +2 -1
  87. arviz/plots/ppcplot.py +1 -0
  88. arviz/plots/rankplot.py +3 -2
  89. arviz/plots/separationplot.py +1 -0
  90. arviz/plots/traceplot.py +1 -0
  91. arviz/plots/tsplot.py +1 -0
  92. arviz/plots/violinplot.py +2 -1
  93. arviz/preview.py +17 -0
  94. arviz/rcparams.py +28 -2
  95. arviz/sel_utils.py +1 -0
  96. arviz/static/css/style.css +2 -1
  97. arviz/stats/density_utils.py +2 -1
  98. arviz/stats/diagnostics.py +15 -11
  99. arviz/stats/ecdf_utils.py +12 -8
  100. arviz/stats/stats.py +31 -16
  101. arviz/stats/stats_refitting.py +1 -0
  102. arviz/stats/stats_utils.py +13 -7
  103. arviz/tests/base_tests/test_data.py +15 -2
  104. arviz/tests/base_tests/test_data_zarr.py +0 -1
  105. arviz/tests/base_tests/test_diagnostics.py +1 -0
  106. arviz/tests/base_tests/test_diagnostics_numba.py +2 -6
  107. arviz/tests/base_tests/test_helpers.py +2 -2
  108. arviz/tests/base_tests/test_labels.py +1 -0
  109. arviz/tests/base_tests/test_plot_utils.py +5 -13
  110. arviz/tests/base_tests/test_plots_matplotlib.py +98 -7
  111. arviz/tests/base_tests/test_rcparams.py +12 -0
  112. arviz/tests/base_tests/test_stats.py +5 -5
  113. arviz/tests/base_tests/test_stats_numba.py +2 -7
  114. arviz/tests/base_tests/test_stats_utils.py +1 -0
  115. arviz/tests/base_tests/test_utils.py +3 -2
  116. arviz/tests/base_tests/test_utils_numba.py +2 -5
  117. arviz/tests/external_tests/test_data_pystan.py +5 -5
  118. arviz/tests/helpers.py +18 -10
  119. arviz/utils.py +4 -0
  120. arviz/wrappers/__init__.py +1 -0
  121. {arviz-0.17.1.dist-info → arviz-0.19.0.dist-info}/METADATA +13 -9
  122. arviz-0.19.0.dist-info/RECORD +183 -0
  123. arviz-0.17.1.dist-info/RECORD +0 -182
  124. {arviz-0.17.1.dist-info → arviz-0.19.0.dist-info}/LICENSE +0 -0
  125. {arviz-0.17.1.dist-info → arviz-0.19.0.dist-info}/WHEEL +0 -0
  126. {arviz-0.17.1.dist-info → arviz-0.19.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,5 @@
1
1
  """Bokeh pareto shape plot."""
2
+
2
3
  from collections.abc import Iterable
3
4
 
4
5
  from matplotlib import cm
@@ -20,6 +21,7 @@ def plot_khat(
20
21
  figsize,
21
22
  xdata,
22
23
  khats,
24
+ good_k,
23
25
  kwargs,
24
26
  threshold,
25
27
  coord_labels,
@@ -52,7 +54,11 @@ def plot_khat(
52
54
 
53
55
  if hlines_kwargs is None:
54
56
  hlines_kwargs = {}
55
- hlines_kwargs.setdefault("hlines", [0, 0.5, 0.7, 1])
57
+
58
+ if good_k is None:
59
+ good_k = 0.7
60
+
61
+ hlines_kwargs.setdefault("hlines", [0, good_k, 1])
56
62
 
57
63
  cmap = None
58
64
  if isinstance(color, str):
@@ -74,7 +80,7 @@ def plot_khat(
74
80
  rgba_c = cmap(color)
75
81
 
76
82
  khats = khats if isinstance(khats, np.ndarray) else khats.values.flatten()
77
- alphas = 0.5 + 0.2 * (khats > 0.5) + 0.3 * (khats > 1)
83
+ alphas = 0.5 + 0.2 * (khats > good_k) + 0.3 * (khats > 1)
78
84
 
79
85
  rgba_c = vectorized_to_hex(rgba_c)
80
86
 
@@ -129,7 +135,7 @@ def plot_khat(
129
135
  xmax = len(khats)
130
136
 
131
137
  if show_bins:
132
- bin_edges = np.array([ymin, 0.5, 0.7, 1, ymax])
138
+ bin_edges = np.array([ymin, good_k, 1, ymax])
133
139
  bin_edges = bin_edges[(bin_edges >= ymin) & (bin_edges <= ymax)]
134
140
  hist, _, _ = histogram(khats, bin_edges)
135
141
  for idx, count in enumerate(hist):
@@ -1,4 +1,5 @@
1
1
  """Bokeh linear regression plot."""
2
+
2
3
  import numpy as np
3
4
  from bokeh.models.annotations import Legend
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Bokeh loopitplot."""
2
+
2
3
  import numpy as np
3
4
  from bokeh.models import BoxAnnotation
4
5
  from matplotlib.colors import hsv_to_rgb, rgb_to_hsv, to_hex, to_rgb
@@ -1,4 +1,5 @@
1
1
  """Bokeh mcseplot."""
2
+
2
3
  import numpy as np
3
4
  from bokeh.models import ColumnDataSource, Span
4
5
  from bokeh.models.glyphs import Scatter
@@ -1,4 +1,5 @@
1
1
  """Bokeh pairplot."""
2
+
2
3
  import warnings
3
4
  from copy import deepcopy
4
5
  from uuid import uuid4
@@ -173,12 +174,8 @@ def plot_pair(
173
174
  source = ColumnDataSource(data=source_dict)
174
175
 
175
176
  if divergences:
176
- source_nondiv = CDSView(
177
- source=source, filters=[GroupFilter(column_name=divergenve_name, group="0")]
178
- )
179
- source_div = CDSView(
180
- source=source, filters=[GroupFilter(column_name=divergenve_name, group="1")]
181
- )
177
+ source_nondiv = CDSView(filter=GroupFilter(column_name=divergenve_name, group="0"))
178
+ source_div = CDSView(filter=GroupFilter(column_name=divergenve_name, group="1"))
182
179
 
183
180
  def get_width_and_height(jointplot, rotate):
184
181
  """Compute subplots dimensions for two or more variables."""
@@ -1,4 +1,5 @@
1
1
  """Bokeh Parallel coordinates plot."""
2
+
2
3
  import numpy as np
3
4
  from bokeh.models import DataRange1d
4
5
  from bokeh.models.tickers import FixedTicker
@@ -1,4 +1,5 @@
1
1
  """Bokeh Plot posterior densities."""
2
+
2
3
  from numbers import Number
3
4
  from typing import Optional
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Bokeh Posterior predictive plot."""
2
+
2
3
  import numpy as np
3
4
  from bokeh.models.annotations import Legend
4
5
  from bokeh.models.glyphs import Scatter
@@ -1,4 +1,5 @@
1
1
  """Bokeh rankplot."""
2
+
2
3
  import numpy as np
3
4
 
4
5
  from bokeh.models import Span
@@ -1,4 +1,5 @@
1
1
  """Bokeh separation plot."""
2
+
2
3
  import numpy as np
3
4
 
4
5
  from ...plot_utils import _scale_fig_size, vectorized_to_hex
@@ -1,4 +1,5 @@
1
1
  """Bokeh Traceplot."""
2
+
2
3
  import warnings
3
4
  from collections.abc import Iterable
4
5
  from itertools import cycle
@@ -1,4 +1,5 @@
1
1
  """Bokeh Violinplot."""
2
+
2
3
  import numpy as np
3
4
  from bokeh.models.annotations import Title
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib Autocorrplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotib Bayesian p-value Posterior predictive plot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
  from scipy import stats
@@ -1,4 +1,5 @@
1
1
  """Matplotlib Compareplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
 
4
5
  from ...plot_utils import _scale_fig_size
@@ -1,4 +1,5 @@
1
1
  """Matplotlib Densityplot."""
2
+
2
3
  from itertools import cycle
3
4
 
4
5
  import matplotlib.pyplot as plt
@@ -1,4 +1,5 @@
1
1
  """Matplotlib Density Comparison plot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
 
@@ -88,9 +89,7 @@ def plot_dist_comparison(
88
89
  kwargs = (
89
90
  prior_kwargs
90
91
  if group.startswith("prior")
91
- else posterior_kwargs
92
- if group.startswith("posterior")
93
- else observed_kwargs
92
+ else posterior_kwargs if group.startswith("posterior") else observed_kwargs
94
93
  )
95
94
  for idx2, (
96
95
  var_name,
@@ -1,4 +1,5 @@
1
1
  """Matplotlib distplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  from matplotlib import _pylab_helpers
4
5
  import numpy as np
@@ -1,4 +1,5 @@
1
1
  """Matplotlib dotplot."""
2
+
2
3
  import math
3
4
  import warnings
4
5
  import numpy as np
@@ -1,4 +1,5 @@
1
1
  """Matplotlib ecdfplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  from matplotlib.colors import to_hex
4
5
 
@@ -12,7 +13,6 @@ def plot_ecdf(
12
13
  x_bands,
13
14
  lower,
14
15
  higher,
15
- confidence_bands,
16
16
  plot_kwargs,
17
17
  fill_kwargs,
18
18
  plot_outline_kwargs,
@@ -58,7 +58,7 @@ def plot_ecdf(
58
58
 
59
59
  ax.step(x_coord, y_coord, **plot_kwargs)
60
60
 
61
- if confidence_bands:
61
+ if x_bands is not None:
62
62
  if fill_band:
63
63
  ax.fill_between(x_bands, lower, higher, **fill_kwargs)
64
64
  else:
@@ -1,4 +1,5 @@
1
1
  """Matplotlib ELPDPlot."""
2
+
2
3
  import warnings
3
4
 
4
5
  from matplotlib import cm
@@ -1,4 +1,5 @@
1
1
  """Matplotlib energyplot."""
2
+
2
3
  from itertools import cycle
3
4
 
4
5
  import matplotlib.pyplot as plt
@@ -1,4 +1,5 @@
1
1
  """Matplotlib energyplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
  from scipy.stats import rankdata
@@ -127,11 +128,11 @@ def plot_ess(
127
128
  ax_.annotate(
128
129
  "mean",
129
130
  (text_x, mean_ess_i),
130
- va=text_va
131
- if text_va is not None
132
- else "bottom"
133
- if mean_ess_i >= sd_ess_i
134
- else "top",
131
+ va=(
132
+ text_va
133
+ if text_va is not None
134
+ else "bottom" if mean_ess_i >= sd_ess_i else "top"
135
+ ),
135
136
  **text_kwargs,
136
137
  )
137
138
  ax_.axhline(sd_ess_i, **extra_kwargs)
@@ -1,4 +1,5 @@
1
1
  """Matplotlib forestplot."""
2
+
2
3
  from collections import OrderedDict, defaultdict
3
4
  from itertools import tee
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib hdiplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  from matplotlib import _pylab_helpers
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib kdeplot."""
2
+
2
3
  import numpy as np
3
4
  from matplotlib import pyplot as plt
4
5
  from matplotlib import _pylab_helpers
@@ -162,10 +163,11 @@ def plot_kde(
162
163
  ax.grid(False)
163
164
  if contour:
164
165
  qcfs = ax.contourf(x_x, y_y, density, antialiased=True, **contourf_kwargs)
165
- qcs = ax.contour(x_x, y_y, density, **contour_kwargs)
166
+ ax.contour(x_x, y_y, density, **contour_kwargs)
166
167
  if not fill_last:
167
- qcfs.collections[0].set_alpha(0)
168
- qcs.collections[0].set_alpha(0)
168
+ alpha = np.ones(len(qcfs.allsegs), dtype=float)
169
+ alpha[0] = 0
170
+ qcfs.set_alpha(alpha)
169
171
  else:
170
172
  ax.pcolormesh(x_x, y_y, density, **pcolormesh_kwargs)
171
173
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib khatplot."""
2
+
2
3
  import warnings
3
4
 
4
5
  import matplotlib as mpl
@@ -19,6 +20,7 @@ def plot_khat(
19
20
  figsize,
20
21
  xdata,
21
22
  khats,
23
+ good_k,
22
24
  kwargs,
23
25
  threshold,
24
26
  coord_labels,
@@ -60,8 +62,11 @@ def plot_khat(
60
62
  backend_kwargs.setdefault("figsize", figsize)
61
63
  backend_kwargs["squeeze"] = True
62
64
 
65
+ if good_k is None:
66
+ good_k = 0.7
67
+
63
68
  hlines_kwargs = matplotlib_kwarg_dealiaser(hlines_kwargs, "hlines")
64
- hlines_kwargs.setdefault("hlines", [0, 0.5, 0.7, 1])
69
+ hlines_kwargs.setdefault("hlines", [0, good_k, 1])
65
70
  hlines_kwargs.setdefault("linestyle", [":", "-.", "--", "-"])
66
71
  hlines_kwargs.setdefault("alpha", 0.7)
67
72
  hlines_kwargs.setdefault("zorder", -1)
@@ -101,7 +106,7 @@ def plot_khat(
101
106
  rgba_c = cmap(norm_fun(color))
102
107
 
103
108
  khats = khats if isinstance(khats, np.ndarray) else khats.values.flatten()
104
- alphas = 0.5 + 0.2 * (khats > 0.5) + 0.3 * (khats > 1)
109
+ alphas = 0.5 + 0.2 * (khats > good_k) + 0.3 * (khats > 1)
105
110
  rgba_c[:, 3] = alphas
106
111
  rgba_c = vectorized_to_hex(rgba_c)
107
112
  kwargs["c"] = rgba_c
@@ -150,7 +155,7 @@ def plot_khat(
150
155
  )
151
156
 
152
157
  if show_bins:
153
- bin_edges = np.array([ymin, 0.5, 0.7, 1, ymax])
158
+ bin_edges = np.array([ymin, good_k, 1, ymax])
154
159
  bin_edges = bin_edges[(bin_edges >= ymin) & (bin_edges <= ymax)]
155
160
  hist, _, _ = histogram(khats, bin_edges)
156
161
  for idx, count in enumerate(hist):
@@ -1,4 +1,5 @@
1
1
  """Matplotlib plot linear regression figure."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib loopitplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
  from matplotlib.colors import hsv_to_rgb, rgb_to_hsv, to_hex, to_rgb
@@ -1,4 +1,5 @@
1
1
  """Matplotlib mcseplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
  from scipy.stats import rankdata
@@ -94,22 +95,22 @@ def plot_mcse(
94
95
  ax_.annotate(
95
96
  "mean",
96
97
  (text_x, mean_mcse_i),
97
- va=text_va
98
- if text_va is not None
99
- else "bottom"
100
- if mean_mcse_i > sd_mcse_i
101
- else "top",
98
+ va=(
99
+ text_va
100
+ if text_va is not None
101
+ else "bottom" if mean_mcse_i > sd_mcse_i else "top"
102
+ ),
102
103
  **text_kwargs,
103
104
  )
104
105
  ax_.axhline(sd_mcse_i, **extra_kwargs)
105
106
  ax_.annotate(
106
107
  "sd",
107
108
  (text_x, sd_mcse_i),
108
- va=text_va
109
- if text_va is not None
110
- else "bottom"
111
- if sd_mcse_i >= mean_mcse_i
112
- else "top",
109
+ va=(
110
+ text_va
111
+ if text_va is not None
112
+ else "bottom" if sd_mcse_i >= mean_mcse_i else "top"
113
+ ),
113
114
  **text_kwargs,
114
115
  )
115
116
  if rug:
@@ -1,4 +1,5 @@
1
1
  """Matplotlib pairplot."""
2
+
2
3
  import warnings
3
4
  from copy import deepcopy
4
5
 
@@ -333,7 +334,7 @@ def plot_pair(
333
334
  if reference_values:
334
335
  x_name = flat_var_names[i]
335
336
  y_name = flat_var_names[j + not_marginals]
336
- if x_name and y_name not in difference:
337
+ if (x_name not in difference) and (y_name not in difference):
337
338
  ax[j, i].plot(
338
339
  reference_values_copy[x_name],
339
340
  reference_values_copy[y_name],
@@ -1,4 +1,5 @@
1
1
  """Matplotlib Parallel coordinates plot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib Plot posterior densities."""
2
+
2
3
  from numbers import Number
3
4
 
4
5
  import matplotlib.pyplot as plt
@@ -1,4 +1,5 @@
1
1
  """Matplotlib Posterior predictive plot."""
2
+
2
3
  import logging
3
4
  import platform
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib rankplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib separation plot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib traceplot."""
2
+
2
3
  import warnings
3
4
  from itertools import cycle
4
5
 
@@ -439,7 +440,7 @@ def plot_trace(
439
440
  [], [], label="combined", **dealiase_sel_kwargs(plot_kwargs, chain_prop, -1)
440
441
  ),
441
442
  )
442
- ax.figure.axes[0].legend(handles=handles, title="chain", loc="upper right")
443
+ ax.figure.axes[1].legend(handles=handles, title="chain", loc="upper right")
443
444
 
444
445
  if axes is None:
445
446
  axes = np.array(ax.figure.axes).reshape(-1, 2)
@@ -1,4 +1,5 @@
1
1
  """Matplotlib plot time series figure."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Matplotlib Violinplot."""
2
+
2
3
  import matplotlib.pyplot as plt
3
4
  import numpy as np
4
5
 
@@ -60,7 +61,7 @@ def plot_violin(
60
61
  cols,
61
62
  backend_kwargs=backend_kwargs,
62
63
  )
63
- fig.set_constrained_layout(False)
64
+ fig.set_layout_engine("none")
64
65
  fig.subplots_adjust(wspace=0)
65
66
 
66
67
  ax = np.atleast_1d(ax)
arviz/plots/bpvplot.py CHANGED
@@ -1,4 +1,5 @@
1
1
  """Bayesian p-value Posterior/Prior predictive plot."""
2
+
2
3
  import numpy as np
3
4
 
4
5
  from ..labels import BaseLabeller
@@ -79,7 +80,7 @@ def plot_bpv(
79
80
  hdi_prob : float, optional
80
81
  Probability for the highest density interval for the analytical reference distribution when
81
82
  ``kind=u_values``. Should be in the interval (0, 1]. Defaults to the
82
- rcParam ``stats.hdi_prob``. See :ref:`this section <common_hdi_prob>` for usage examples.
83
+ rcParam ``stats.ci_prob``. See :ref:`this section <common_hdi_prob>` for usage examples.
83
84
  color : str, optional
84
85
  Matplotlib color
85
86
  grid : tuple, optional
@@ -201,7 +202,7 @@ def plot_bpv(
201
202
  raise TypeError("`reference` argument must be either `analytical`, `samples`, or `None`")
202
203
 
203
204
  if hdi_prob is None:
204
- hdi_prob = rcParams["stats.hdi_prob"]
205
+ hdi_prob = rcParams["stats.ci_prob"]
205
206
  elif not 1 >= hdi_prob > 0:
206
207
  raise ValueError("The value of hdi_prob should be in the interval (0, 1]")
207
208
 
@@ -1,4 +1,5 @@
1
1
  """Summary plot for model comparison."""
2
+
2
3
  import numpy as np
3
4
 
4
5
  from ..labels import BaseLabeller
@@ -1,4 +1,5 @@
1
1
  """KDE and histogram plots for multiple variables."""
2
+
2
3
  import warnings
3
4
 
4
5
  from ..data import convert_to_dataset
@@ -208,7 +209,7 @@ def plot_density(
208
209
  )
209
210
 
210
211
  if hdi_prob is None:
211
- hdi_prob = rcParams["stats.hdi_prob"]
212
+ hdi_prob = rcParams["stats.ci_prob"]
212
213
  elif not 1 >= hdi_prob > 0:
213
214
  raise ValueError("The value of hdi_prob should be in the interval (0, 1]")
214
215
 
@@ -1,4 +1,5 @@
1
1
  """Density Comparison plot."""
2
+
2
3
  import warnings
3
4
  from ..labels import BaseLabeller
4
5
  from ..rcparams import rcParams
arviz/plots/dotplot.py CHANGED
@@ -1,4 +1,5 @@
1
1
  """Plot distribution as dot plot or quantile dot plot."""
2
+
2
3
  import numpy as np
3
4
 
4
5
  from ..rcparams import rcParams
@@ -66,7 +67,7 @@ def plot_dot(
66
67
  The shape of the marker. Valid for matplotlib backend.
67
68
  hdi_prob : float, optional
68
69
  Valid only when point_interval is True. Plots HDI for chosen percentage of density.
69
- Defaults to ``stats.hdi_prob`` rcParam. See :ref:`this section <common_hdi_prob>`
70
+ Defaults to ``stats.ci_prob`` rcParam. See :ref:`this section <common_hdi_prob>`
70
71
  for usage examples.
71
72
  rotated : bool, default False
72
73
  Whether to rotate the dot plot by 90 degrees.
@@ -150,7 +151,7 @@ def plot_dot(
150
151
  values.sort()
151
152
 
152
153
  if hdi_prob is None:
153
- hdi_prob = rcParams["stats.hdi_prob"]
154
+ hdi_prob = rcParams["stats.ci_prob"]
154
155
  elif not 1 >= hdi_prob > 0:
155
156
  raise ValueError("The value of hdi_prob should be in the interval (0, 1]")
156
157