10000 Merge pull request #13881 from meeseeksmachine/auto-backport-of-pr-13… · astropy/astropy@07eacee · GitHub
[go: up one dir, main page]

Skip to content

Commit 07eacee

Browse files
authored
Merge pull request #13881 from meeseeksmachine/auto-backport-of-pr-13880-on-v5.0.x
Backport PR #13880 on branch v5.0.x (Update `WCSAxes` to pass multiple positional arguments to `Axes`)
2 parents c3e46a3 + 78b6523 commit 07eacee

File tree

1 file changed

+13
-5
lines changed
  • astropy/visualization/wcsaxes

1 file changed

+13
-5
lines changed

astropy/visualization/wcsaxes/core.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,17 @@ class WCSAxes(Axes):
5555
----------
5656
fig : `~matplotlib.figure.Figure`
5757
The figure to add the axes to
58-
rect : list
59-
The position of the axes in the figure in relative units. Should be
60-
given as ``[left, bottom, width, height]``.
58+
*args
59+
``*args`` can be a single ``(left, bottom, width, height)``
60+
rectangle or a single `matplotlib.transforms.Bbox`. This specifies
61+
the rectangle (in figure coordinates) where the Axes is positioned.
62+
``*args`` can also consist of three numbers or a single three-digit
63+
number; in the latter case, the digits are considered as
64+
independent numbers. The numbers are interpreted as ``(nrows,
65+
ncols, index)``: ``(nrows, ncols)`` specifies the size of an array
66+
of subplots, and ``index`` is the 1-based index of the subplot
67+
being created. Finally, ``*args`` can also directly be a
68+
`matplotlib.gridspec.SubplotSpec` instance.
6169
wcs : :class:`~astropy.wcs.WCS`, optional
6270
The WCS for the data. If this is specified, ``transform`` cannot be
6371
specified.
@@ -96,13 +104,13 @@ class WCSAxes(Axes):
96104
:class:`~astropy.visualization.wcsaxes.frame.RectangularFrame`
97105
"""
98106

99-
def __init__(self, fig, rect, wcs=None, transform=None, coord_meta=None,
107+
def __init__(self, fig, *args, wcs=None, transform=None, coord_meta=None,
100108
transData=None, slices=None, frame_class=None,
101109
**kwargs):
102110
"""
103111
"""
104112

105-
super().__init__(fig, rect, **kwargs)
113+
super().__init__(fig, *args, **kwargs)
106114
self._bboxes = []
107115

108116
if frame_class is not None:

0 commit comments

Comments
 (0)
0