Skip to content
Merged
Changes from all commits
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
10 changes: 8 additions & 2 deletions named_arrays/plt.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def subplots(
sharex: bool | Literal["none", "all", "row", "col"] = False,
sharey: bool | Literal["none", "all", "row", "col"] = False,
squeeze: bool = True,
origin: Literal["lower", "upper"] = "lower",
**kwargs,
) -> tuple[
matplotlib.figure.Figure,
Expand Down Expand Up @@ -97,6 +98,10 @@ def subplots(
If :obj:`True`, :func:`numpy.squeeze` is called on the result, which removes singleton dimensions from the
array.
See the documentation of :func:`matplotlib.pyplot.subplots` for more information.
origin
Place the (0, 0) axis in the upper-left or lower-left corner.
Defaults to lower-left since this mirrors the mathematical convention,
but this is the opposite convention adopted by :func:`matplotlib.pyplot.subplots`.
kwargs
Additional keyword arguments passed to :func:`matplotlib.pyplot.subplots`
"""
Expand All @@ -117,8 +122,9 @@ def subplots(

axs = na.ScalarArray(axs, axes=tuple(shape.keys()))

if axis_rows in shape:
axs = axs[{axis_rows: slice(None, None, -1)}]
if origin == "lower":
if axis_rows in shape:
axs = axs[{axis_rows: slice(None, None, -1)}]

return fig, axs

Expand Down
Loading