8000 removal of deprecated · matplotlib/matplotlib@f448c0f · GitHub
[go: up one dir, main page]

Skip to content

Commit f448c0f

Browse files
committed
removal of deprecated
fix pyi fix pyi
1 parent 37f26da commit f448c0f

File tree

4 files changed

+16
-47
lines changed

4 files changed

+16
-47
lines changed

doc/api/artist_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Inheritance Diagrams
1212
====================
1313

14-
.. inheritance-diagram:: matplotlib.axes._axes.Axes matplotlib.axes._base._AxesBase matplotlib.axis.Axis matplotlib.axis.Tick matplotlib.axis.XAxis matplotlib.axis.XTick matplotlib.axis.YAxis matplotlib.axis.YTick matplotlib.collections.AsteriskPolygonCollection matplotlib.collections.BrokenBarHCollection matplotlib.collections.CircleCollection matplotlib.collections.Collection matplotlib.collections.EllipseCollection matplotlib.collections.EventCollection matplotlib.collections.LineCollection matplotlib.collections.PatchCollection matplotlib.collections.PathCollection matplotlib.collections.PolyCollection matplotlib.collections.QuadMesh matplotlib.collections.RegularPolyCollection matplotlib.collections.StarPolygonCollection matplotlib.collections.TriMesh matplotlib.collections._CollectionWithSizes matplotlib.contour.ClabelText matplotlib.contour.ContourSet matplotlib.contour.QuadContourSet matplotlib.figure.FigureBase matplotlib.figure.Figure matplotlib.figure.SubFigure matplotlib.image.AxesImage matplotlib.image.BboxImage matplotlib.image.FigureImage matplotlib.image.NonUniformImage matplotlib.image.PcolorImage matplotlib.image._ImageBase matplotlib.legend.Legend matplotlib.lines.Line2D matplotlib.offsetbox.AnchoredOffsetbox matplotlib.offsetbox.AnchoredText matplotlib.offsetbox.AnnotationBbox matplotlib.offsetbox.AuxTransformBox matplotlib.offsetbox.DrawingArea matplotlib.offsetbox.HPacker matplotlib.offsetbox.OffsetBox matplotlib.offsetbox.OffsetImage matplotlib.offsetbox.PackerBase matplotlib.offsetbox.PaddedBox matplotlib.offsetbox.TextArea matplotlib.offsetbox.VPacker matplotlib.patches.Annulus matplotlib.patches.Arc matplotlib.patches.Arrow matplotlib.patches.Circle matplotlib.patches.CirclePolygon matplotlib.patches.ConnectionPatch matplotlib.patches.Ellipse matplotlib.patches.FancyArrow matplotlib.patches.FancyArrowPatch matplotlib.patches.FancyBboxPatch matplotlib.patches.Patch matplotlib.patches.PathPatch matplotlib.patches.Polygon matplotlib.patches.Rectangle matplotlib.patches.RegularPolygon matplotlib.patches.Shadow matplotlib.patches.StepPatch matplotlib.patches.Wedge matplotlib.projections.geo.AitoffAxes matplotlib.projections.geo.GeoAxes matplotlib.projections.geo.HammerAxes matplotlib.projections.geo.LambertAxes matplotlib.projections.geo.MollweideAxes matplotlib.projections.polar.PolarAxes matplotlib.projections.polar.RadialAxis matplotlib.projections.polar.RadialTick matplotlib.projections.polar.ThetaAxis matplotlib.projections.polar.ThetaTick matplotlib.quiver.Barbs matplotlib.quiver.Quiver matplotlib.quiver.QuiverKey matplotlib.spines.Spine matplotlib.table.Cell matplotlib.table.Table matplotlib.text.Annotation matplotlib.text.Text matplotlib.tri.TriContourSet
14+
.. inheritance-diagram:: matplotlib.axes._axes.Axes matplotlib.axes._base._AxesBase matplotlib.axis.Axis matplotlib.axis.Tick matplotlib.axis.XAxis matplotlib.axis.XTick matplotlib.axis.YAxis matplotlib.axis.YTick matplotlib.collections.AsteriskPolygonCollection matplotlib.collections.BrokenBarHCollection matplotlib.collections.CircleCollection matplotlib.collections.Collection matplotlib.collections.EllipseCollection matplotlib.collections.EventCollection matplotlib.collections.LineCollection matplotlib.collections.PatchCollection matplotlib.collections.PathCollection matplotlib.collections.PolyCollection matplotlib.collections.QuadMesh matplotlib.collections.RegularPolyCollection matplotlib.collections.StarPolygonCollection matplotlib.collections.TriMesh matplotlib.collections._CollectionWithSizes matplotlib.contour.ContourSet matplotlib.contour.QuadContourSet matplotlib.figure.FigureBase matplotlib.figure.Figure matplotlib.figure.SubFigure matplotlib.image.AxesImage matplotlib.image.BboxImage matplotlib.image.FigureImage matplotlib.image.NonUniformImage matplotlib.image.PcolorImage matplotlib.image._ImageBase matplotlib.legend.Legend matplotlib.lines.Line2D matplotlib.offsetbox.AnchoredOffsetbox matplotlib.offsetbox.AnchoredText matplotlib.offsetbox.AnnotationBbox matplotlib.offsetbox.AuxTransformBox matplotlib.offsetbox.DrawingArea matplotlib.offsetbox.HPacker matplotlib.offsetbox.OffsetBox matplotlib.offsetbox.OffsetImage matplotlib.offsetbox.PackerBase matplotlib.offsetbox.PaddedBox matplotlib.offsetbox.TextArea matplotlib.offsetbox.VPacker matplotlib.patches.Annulus matplotlib.patches.Arc matplotlib.patches.Arrow matplotlib.patches.Circle matplotlib.patches.CirclePolygon matplotlib.patches.ConnectionPatch matplotlib.patches.Ellipse matplotlib.patches.FancyArrow matplotlib.patches.FancyArrowPatch matplotlib.patches.FancyBboxPatch matplotlib.patches.Patch matplotlib.patches.PathPatch matplotlib.patches.Polygon matplotlib.patches.Rectangle matplotlib.patches.RegularPolygon matplotlib.patches.Shadow matplotlib.patches.StepPatch matplotlib.patches.Wedge matplotlib.projections.geo.AitoffAxes matplotlib.projections.geo.GeoAxes matplotlib.projections.geo.HammerAxes matplotlib.projections.geo.LambertAxes matplotlib.projections.geo.MollweideAxes matplotlib.projections.polar.PolarAxes matplotlib.projections.polar.RadialAxis matplotlib.projections.polar.RadialTick matplotlib.projections.polar.ThetaAxis matplotlib.projections.polar.ThetaTick matplotlib.quiver.Barbs matplotlib.quiver.Quiver matplotlib.quiver.QuiverKey matplotlib.spines.Spine matplotlib.table.Cell matplotlib.table.Table matplotlib.text.Annotation matplotlib.text.Text matplotlib.tri.TriContourSet
1515
:parts: 1
1616
:private-bases:
1717

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
``contour.ClabelText`` and ``ContourLabeler.set_label_props``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... are removed.
4+
5+
Use ``Text(..., transform_rotates_text=True)`` as a replacement for
6+
``contour.ClabelText(...)`` and ``text.set(text=text, color=color,
7+
fontproperties=labeler.labelFontProps, clip_box=labeler.axes.bbox)`` as a
8+
replacement for the ``ContourLabeler.set_label_props(label, text, color)``.
9+
10+
``ContourLabeler`` attributes
11+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12+
The ``labelFontProps``, ``labelFontSizeList``, and ``labelTextsList``
13+
attributes of `.ContourLabeler` have been removed. Use the ``labelTexts``
14+
attribute and the font properties of the corresponding text objects instead.

lib/matplotlib/contour.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@
2525
import matplotlib.transforms as mtransforms
2626

2727

28-
@_api.deprecated("3.7", alternative="Text.set_transform_rotates_text")
29-
class ClabelText(Text):
30-
"""
31-
Unlike the ordinary text, the get_rotation returns an updated
32-
angle in the pixel coordinate assuming that the input rotation is
33-
an angle in data coordinate (or whatever transform set).
34-
"""
35-
36-
def get_rotation(self):
37-
new_angle, = self.get_transform().transform_angles(
38-
[super().get_rotation()], [self.get_position()])
39-
return new_angle
40-
41-
4228
def _contour_labeler_event_handler(cs, inline, inline_spacing, event):
4329
canvas = cs.axes.figure.canvas
4430
is_button = event.name == "button_press_event"
@@ -223,22 +209,6 @@ def clabel(self, levels=None, *,
223209

224210
return cbook.silent_list('text.Text', self.labelTexts)
225211

226-
@_api.deprecated("3.7", alternative="cs.labelTexts[0].get_font()")
227-
@property
228-
def labelFontProps(self):
229-
return self._label_font_props
230-
231-
@_api.deprecated("3.7", alternative=(
232-
"[cs.labelTexts[0].get_font().get_size()] * len(cs.labelLevelList)"))
233-
@property
234-
def labelFontSizeList(self):
235-
return [self._label_font_props.get_size()] * len(self.labelLevelList)
236-
237-
@_api.deprecated("3.7", alternative="cs.labelTexts")
238-
@property
239-
def labelTextsList(self):
240-
return cbook.silent_list('text.Text', self.labelTexts)
241-
242212
def print_label(self, linecontour, labelwidth):
243213
"""Return whether a contour is long enough to hold a label."""
244214
return (len(linecontour) > 10 * labelwidth
@@ -260,14 +230,6 @@ def _get_nth_label_width(self, nth):
260230
figure=fig, fontproperties=self._label_font_props)
261231
.get_window_extent(renderer).width)
262232

263-
@_api.deprecated("3.7", alternative="Artist.set")
264-
def set_label_props(self, label, text, color):
265-
"""Set the label properties - color, fontsize, text."""
266-
label.set_text(text)
267-
label.set_color(color)
268-
label.set_fontproperties(self._label_font_props)
269-
label.set_clip_box(self.axes.bbox)
270-
271233
def get_text(self, lev, fmt):
272234
"""Get the text of the label."""
273235
if isinstance(lev, str):

lib/matplotlib/contour.pyi

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ from collections.abc import Callable, Iterable, Sequence
1616
from typing import Literal
1717
from .typing import ColorType
1818

19-
class ClabelText(Text): ...
19+
2020

2121
class ContourLabeler:
2222
labelFmt: str | Formatter | Callable[[float], str] | dict[float, str]
@@ -41,15 +41,8 @@ class ContourLabeler:
4141
rightside_up: bool = ...,
4242
zorder: float | None = ...
4343
) -> list[Text]: ...
44-
@property
45-
def labelFontProps(self) -> FontProperties: ...
46-
@property
47-
def labelFontSizeList(self) -> list[float]: ...
48-
@property
49-
def labelTextsList(self) -> list[Text]: ...
5044
def print_label(self, linecontour: ArrayLike, labelwidth: float) -> bool: ...
5145
def too_close(self, x: float, y: float, lw: float) -> bool: ...
52-
def set_label_props(self, label: Text, text: str, color: ColorType) -> None: ...
5346
def get_text(
5447
self,
5548
lev: float,

0 commit comments

Comments
 (0)
0