Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Return axes_grid of panels, fix _panels_kwargs bug
  • Loading branch information
lukelbd committed Sep 3, 2019
commit c264999ee5c6ed6329d9d39905ee223430cd594b
14 changes: 6 additions & 8 deletions proplot/subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,8 @@ def __getattr__(self, attr):
def null_iterator(*args, **kwargs):
return None
return null_iterator
# Panels
if all(isinstance(_, (axes_grid, axes.Axes))
for _ in attrs):
return axes_grid(attrs)
# Objects
elif not any(callable(_) for _ in attrs):
if not any(callable(_) for _ in attrs):
if len(self) == 1:
return attrs[0]
else:
Expand All @@ -231,6 +227,8 @@ def axes_grid_iterator(*args, **kwargs):
return ret[0]
elif all(res is None for res in ret):
return None
elif all(isinstance(res, axes.Axes) for res in ret):
return axes_grid(ret, n=self._n, order=self._order)
else:
return ret
return axes_grid_iterator
Expand Down Expand Up @@ -752,7 +750,7 @@ def _add_axes_panel(self, ax, side, filled=False, **kwargs):
raise ValueError(f'Invalid side {side!r}.')
side = _side_translate[s]
share, width, space, space_orig = _panels_kwargs(s,
kwargs, filled=filled, figure=False)
filled=filled, figure=False, **kwargs)

# Get gridspec and subplotspec indices
subplotspec = ax.get_subplotspec()
Expand Down Expand Up @@ -798,8 +796,8 @@ def _add_figure_panel(self, side, span=None, **kwargs):
if s not in 'lrbt':
raise ValueError(f'Invalid side {side!r}.')
side = _side_translate[s]
_, width, space, space_orig = _panels_kwargs(s, kwargs,
filled=True, figure=True)
_, width, space, space_orig = _panels_kwargs(s,
filled=True, figure=True, **kwargs)

# Get props
subplots_kw = self._subplots_kw
Expand Down