Skip to content

Commit

Permalink
Fix bug with shared axes (#283)
Browse files Browse the repository at this point in the history
* Fix bug with shared axes
  • Loading branch information
b5y authored and vuolleko committed Aug 2, 2018
1 parent f6b9343 commit 22dd578
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions elfi/visualization/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,14 @@ def _create_axes(axes, shape, **kwargs):
"""
fig_kwargs = {}
kwargs['figsize'] = kwargs.get('figsize', (16, 4 * shape[0]))
for k in ['figsize', 'dpi', 'num']:
for k in ['figsize', 'sharex', 'sharey', 'dpi', 'num']:
if k in kwargs.keys():
fig_kwargs[k] = kwargs.pop(k)

if axes is not None:
axes = np.atleast_2d(axes)
else:
fig, axes = plt.subplots(ncols=shape[1], nrows=shape[0],
sharex=kwargs.get('sharex', 'none'),
sharey=kwargs.get('sharey', 'none'), **fig_kwargs)
fig, axes = plt.subplots(ncols=shape[1], nrows=shape[0], **fig_kwargs)
axes = np.atleast_2d(axes)
fig.tight_layout(pad=2.0)
return axes, kwargs
Expand Down

0 comments on commit 22dd578

Please sign in to comment.