Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc82291

Browse files
committed
removed deprecated code from gridspec.py
1 parent 04e1332 commit bc82291

File tree

3 files changed

+13
-24
lines changed

3 files changed

+13
-24
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``raw``
2+
~~~~~~~
3+
4+
... of `.get_grid_positions` is removed without replacements.

lib/matplotlib/gridspec.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ def get_height_ratios(self):
141141
"""
142142
return self._row_height_ratios
143143

144-
@_api.delete_parameter("3.7", "raw")
145-
def get_grid_positions(self, fig, raw=False):
144+
def get_grid_positions(self, fig):
146145
"""
147146
Return the positions of the grid cells in figure coordinates.
148147
@@ -151,11 +150,6 @@ def get_grid_positions(self, fig, raw=False):
151150
fig : `~matplotlib.figure.Figure`
152151
The figure the grid should be applied to. The subplot parameters
153152
(margins and spacing between subplots) are taken from *fig*.
154-
raw : bool, default: False
155-
If *True*, the subplot parameters of the figure are not taken
156-
into account. The grid spans the range [0, 1] in both directions
157-
without margins and there is no space between grid cells. This is
158-
used for constrained_layout.
159153
160154
Returns
161155
-------
@@ -164,22 +158,13 @@ def get_grid_positions(self, fig, raw=False):
164158
figure coordinates.
165159
"""
166160
nrows, ncols = self.get_geometry()
167-
168-
if raw:
169-
left = 0.
170-
right = 1.
171-
bottom = 0.
172-
top = 1.
173-
wspace = 0.
174-
hspace = 0.
175-
else:
176-
subplot_params = self.get_subplot_params(fig)
177-
left = subplot_params.left
178-
right = subplot_params.right
179-
bottom = subplot_params.bottom
180-
top = subplot_params.top
181-
wspace = subplot_params.wspace
182-
hspace = subplot_params.hspace
161+
subplot_params = self.get_subplot_params(fig)
162+
left = subplot_params.left
163+
right = subplot_params.right
164+
bottom = subplot_params.bottom
165+
top = subplot_params.top
166+
wspace = subplot_params.wspace
167+
hspace = subplot_params.hspace
183168
tot_width = right - left
184169
tot_height = top - bottom
185170

lib/matplotlib/gridspec.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GridSpecBase:
3030
def set_height_ratios(self, height_ratios: ArrayLike | None) -> None: ...
3131
def get_height_ratios(self) -> ArrayLike: ...
3232
def get_grid_positions(
33-
self, fig: Figure, raw: bool = ...
33+
self, fig: Figure
3434
) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: ...
3535
@staticmethod
3636
def _check_gridspec_exists(figure: Figure, nrows: int, ncols: int) -> GridSpec: ...

0 commit comments

Comments
 (0)