Skip to content

Commit

Permalink
Use constrained_layout in plot_pair
Browse files Browse the repository at this point in the history
  • Loading branch information
ColCarroll committed Sep 25, 2018
1 parent 7f3e63f commit e5c375d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions arviz/plots/pairplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def plot_pair(data, var_names=None, coords=None, figsize=None, textsize=None, ki
ax.tick_params(labelsize=textsize)

if gs is None and ax is None:
fig, _ = plt.subplots(0, 0, figsize=figsize)
gs = gridspec.GridSpec(numvars - 1, numvars - 1, wspace=0.05, hspace=0.05)
fig = plt.figure(figsize=figsize, constrained_layout=True)
gs = gridspec.GridSpec(numvars - 1, numvars - 1, figure=fig)

axs = []
for i in range(0, numvars - 1):
Expand Down Expand Up @@ -165,5 +165,4 @@ def plot_pair(data, var_names=None, coords=None, figsize=None, textsize=None, ki
ax.tick_params(labelsize=textsize)
axs.append(ax)

fig.tight_layout()
return ax, gs
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
matplotlib
matplotlib>=2.1
numpy
scipy
pandas
Expand Down

0 comments on commit e5c375d

Please sign in to comment.