Skip to content

Commit

Permalink
ENH plot.subplots(): width- and height-ratios
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbrodbeck committed Jun 10, 2021
1 parent 26b1777 commit fa5f664
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions eelbrain/plot/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2680,9 +2680,11 @@ def subplots(
left: float = None,
right: float = None,
wspace: float = None,
width_ratios: Sequence[float] = None,
bottom: float = None,
top: float = None,
hspace: float = None,
height_ratios: Sequence[float] = None,
**kwargs,
):
"""Specify :func:`matplotlib.pyplot.subplots` parameters in inches
Expand All @@ -2707,12 +2709,16 @@ def subplots(
Margin to the right of the axes.
wspace
Width of the margin between axes.
width_ratios
The relative widths of the columns (see :class:`matplotlib.gridspec.GridSpec`).
bottom
Margin below the axes.
top
Margin above the axes.
hspace
Height of the margin between axes.
height_ratios
The relative heights of the rows (see :class:`matplotlib.gridspec.GridSpec`).
**
Other parameters for :func:`matplotlib.pyplot.subplots`.
"""
Expand All @@ -2724,9 +2730,11 @@ def subplots(
'left': layout.margins['left'] / layout.w,
'right': 1 - layout.margins['right'] / layout.w,
'wspace': layout.margins['wspace'] / layout.axw,
'width_ratios': width_ratios,
'bottom': layout.margins['bottom'] / layout.h,
'top': 1 - layout.margins['top'] / layout.h,
'hspace': layout.margins['hspace'] / layout.axh,
'height_ratios': height_ratios,
}
return pyplot.subplots(layout.nrow, layout.ncol, figsize=(layout.w, layout.h), gridspec_kw=gridspec_kw, **kwargs)

Expand Down

0 comments on commit fa5f664

Please sign in to comment.