8000 MAINT: Removing deprecated `offset_position` from Collection · matplotlib/matplotlib@39ab96d · GitHub
[go: up one dir, main page]

Skip to content

Commit 39ab96d

Browse files
committed
MAINT: Removing deprecated offset_position from Collection
This removes the 3.3 deprecation of `offset_position` from the Collection class.
1 parent 3bf56aa commit 39ab96d

File tree

2 files changed

+8
-36
lines changed

2 files changed

+8
-36
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Collection's offset_position has been removed
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The deprecated keyword argument *offset_position* has been removed from
5+
the Collection class, along with the setter and getter
6+
``Collection.set_offset_position()`` and ``Collection.get_offset_position()``.
7+
The ``offset_position`` of the Collection class is now "screen".

lib/matplotlib/collections.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class Collection(artist.Artist, cm.ScalarMappable):
7373
# subclass-by-subclass basis.
7474
_edge_default = False
7575

76-
@_api.delete_parameter("3.3", "offset_position")
7776
@docstring.interpd
7877
def __init__(self,
7978
edgecolors=None,
@@ -90,7 +89,7 @@ def __init__(self,
9089
pickradius=5.0,
9190
hatch=None,
9291
urls=None,
93-
offset_position='screen',
92+
*,
9493
zorder=1,
9594
**kwargs
9695
):
@@ -130,9 +129,6 @@ def __init__(self,
130129
transOffset : `~.transforms.Transform`, default: `.IdentityTransform`
131130
A single transform which will be applied to each *offsets* vector
132131
before it is used.
133-
offset_position : {{'screen' (default), 'data' (deprecated)}}
134-
If set to 'data' (deprecated), *offsets* will be treated as if it
135-
is in data coordinates instead of in screen coordinates.
136132
norm : `~.colors.Normalize`, optional
137133
Forwarded to `.ScalarMappable`. The default of
138134
``None`` means that the first draw call will set ``vmin`` and
@@ -184,8 +180,6 @@ def __init__(self,
184180
self.set_urls(urls)
185181
self.set_hatch(hatch)
186182
self._offset_position = "screen"
187-
if offset_position != "screen":
188-
self.set_offset_position(offset_position) # emit deprecation.
189183
self.set_zorder(zorder)
190184

191185
if capstyle:
@@ -561,35 +555,6 @@ def get_offsets(self):
561555
else:
562556
return self._uniform_offsets
563557

564-
@_api.deprecated("3.3")
565-
def set_offset_position(self, offset_position):
566-
"""
567-
Set how offsets are applied. If *offset_position* is 'screen'
568-
(default) the offset is applied after the master transform has
569-
been applied, that is, the offsets are in screen coordinates.
570-
If offset_position is 'data', the offset is applied before the
571-
master transform, i.e., the offsets are in data coordinates.
572-
573-
Parameters
574-
----------
575-
offset_position : {'screen', 'data'}
576-
"""
577-
_api.check_in_list(['screen', 'data'], offset_position=offset_position)
578-
self._offset_position = offset_position
579-
self.stale = True
580-
581-
@_api.deprecated("3.3")
582-
def get_offset_position(self):
583-
"""
584-
Return how offsets are applied for the collection. If
585-
*offset_position* is 'screen', the offset is applied after the
586-
master transform has been applied, that is, the offsets are in
587-
screen coordinates. If offset_position is 'data', the offset
588-
is applied before the master transform, i.e., the offsets are
589-
in data coordinates.
590-
"""
591-
return self._offset_position
592-
593558
def _get_default_linewidth(self):
594559
# This may be overridden in a subclass.
595560
return mpl.rcParams['patch.linewidth'] # validated as float

0 commit comments

Comments
 (0)
0