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

Skip to content

Commit 61b66f4

Browse files
ananya314QuLogic
andcommitted
removed deprecated code from gridspec.py
Co-Authored-By: Elliott Sales de Andrade <[email protected]>
1 parent 04e1332 commit 61b66f4

File tree

4 files changed

+13
-25
lines changed

4 files changed

+13
-25
lines changed

ci/mypy-stubtest-allowlist.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ matplotlib.figure.Figure.set_tight_layout
5353
matplotlib.cm.register_cmap
5454
matplotlib.cm.unregister_cmap
5555
matplotlib.collections.PolyCollection.span_where
56-
matplotlib.gridspec.GridSpecBase.get_grid_positions
5756
matplotlib.widgets.MultiCursor.needclear
5857

5958
# 3.8 deprecations
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``raw`` parameter
2+
~~~~~~~~~~~~~~~~~
3+
4+
... of `.GridSpecBase.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)