10000 Merge pull request #23190 from oscargus/deprecationsinaxis · matplotlib/matplotlib@5dbc3b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5dbc3b1

Browse files
authored
Merge pull request #23190 from oscargus/deprecationsinaxis
Deprecate unused methods in axis.py
2 parents 79f4d3e + cca40bc commit 5dbc3b1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Unused methods in ``Axis``, ``Tick``, ``XAxis``, and ``YAxis``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The following methods are no longer used and deprecated without a replacement::
5+
6+
- ``Axis.get_ticklabel_extents``
7+
- ``Tick.get_pad_pixels``
8+
- ``XAxis.get_text_heights``
9+
- ``YAxis.get_text_widths``

lib/matplotlib/axis.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ def set_clip_path(self, clippath, transform=None):
244244
self.gridline.set_clip_path(clippath, transform)
245245
self.stale = True
246246

247+
@_api.deprecated("3.6")
247248
def get_pad_pixels(self):
248249
return self.figure.dpi * self._base_pad / 72
249250

@@ -1141,6 +1142,7 @@ def _set_artist_props(self, a):
11411142
return
11421143
a.set_figure(self.figure)
11431144

1145+
@_api.deprecated("3.6")
11441146
def get_ticklabel_extents(self, renderer):
11451147
"""Get the extents of the tick labels on either side of the axes."""
11461148
ticks_to_draw = self._update_ticks()
@@ -2253,6 +2255,7 @@ def _update_offset_text_position(self, bboxes, bboxes2):
22532255
y = top + self.OFFSETTEXTPAD * self.figure.dpi / 72
22542256
self.offsetText.set_position((x, y))
22552257

2258+
@_api.deprecated("3.6")
22562259
def get_text_heights(self, renderer):
22572260
"""
22582261
Return how much space should be reserved for text above and below the
@@ -2510,6 +2513,7 @@ def set_offset_position(self, position):
25102513
self.offsetText.set_position((x, y))
25112514
self.stale = True
25122515

2516+
@_api.deprecated("3.6")
25132517
def get_text_widths(self, renderer):
25142518
bbox, bbox2 = self.get_ticklabel_extents(renderer)
25152519
# MGDTODO: Need a better way to get the pad

0 commit comments

Comments
 (0)
0