Skip to content

Commit

Permalink
Fix #453 (#615)
Browse files Browse the repository at this point in the history
* Fix  #453

* Fix tests

modified `assert ax` to `assert np.all(ax)`, which works when ax is an
array of axes or a single axes object.
  • Loading branch information
OriolAbril authored and aloctavodia committed Mar 18, 2019
1 parent 47c2d21 commit 6317c2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions arviz/plots/pairplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ def plot_pair(
ax.set_xlabel("{}".format(flat_var_names[0]), fontsize=ax_labelsize, wrap=True)
ax.set_ylabel("{}".format(flat_var_names[1]), fontsize=ax_labelsize, wrap=True)
ax.tick_params(labelsize=xt_labelsize)
axs = ax

else:
(figsize, ax_labelsize, _, xt_labelsize, _, _) = _scale_fig_size(
Expand All @@ -203,7 +202,6 @@ def plot_pair(
fig, ax = plt.subplots(
numvars - 1, numvars - 1, figsize=figsize, constrained_layout=True
)
axs = []
hexbin_values = []
for i in range(0, numvars - 1):
var1 = _posterior[i]
Expand Down Expand Up @@ -254,6 +252,5 @@ def plot_pair(
)

ax[j, i].tick_params(labelsize=xt_labelsize)
axs.append(ax)

return axs
return ax
2 changes: 1 addition & 1 deletion arviz/tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def test_plot_khat():
def test_plot_pair(models, model_fit, kwargs):
obj = getattr(models, model_fit)
ax = plot_pair(obj, **kwargs)
assert ax
assert np.all(ax)


@pytest.mark.parametrize(
Expand Down

0 comments on commit 6317c2a

Please sign in to comment.