File tree 3 files changed +22
-1
lines changed
doc/api/prev_api_changes/api_changes_3.5.0
3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,10 @@ Miscellaneous deprecations
269
269
- ``cm.LUTSIZE `` is deprecated. Use :rc: `image.lut ` instead. This value only
270
270
affects colormap quantization levels for default colormaps generated at
271
271
module import time.
272
+ - ``Collection.__init__ `` previously ignored *transOffset * without *offsets * also
273
+ being specified. In the future, *transOffset * will begin having an effect
274
+ regardless of *offsets *. In the meantime, if you wish to set *transOffset *,
275
+ call `.Collection.set_offset_transform ` explicitly.
272
276
- ``Colorbar.patch `` is deprecated; this attribute is not correctly updated
273
277
anymore.
274
278
- ``ContourLabeler.get_label_width `` is deprecated.
Original file line number Diff line number Diff line change @@ -202,6 +202,18 @@ def __init__(self,
202
202
if offsets .shape == (2 ,):
203
203
offsets = offsets [None , :]
204
204
self ._offsets = offsets
205
+ elif transOffset is not None :
206
+ _api .warn_deprecated (
207
+ '3.5' ,
208
+ removal = '3.6' ,
209
+ message = 'Passing *transOffset* without *offsets* has no '
210
+ 'effect. This behavior is deprecated since %(since)s '
211
+ 'and %(removal)s, *transOffset* will begin having an '
212
+ 'effect regardless of *offsets*. In the meantime, if '
213
+ 'you wish to set *transOffset*, call '
214
+ 'collection.set_offset_transform(transOffset) '
215
+ 'explicitly.' )
216
+ transOffset = None
205
217
206
218
self ._transOffset = transOffset
207
219
Original file line number Diff line number Diff line change @@ -1072,8 +1072,13 @@ def test_set_offsets_late():
1072
1072
1073
1073
1074
1074
def test_set_offset_transform ():
1075
+ with pytest .warns (MatplotlibDeprecationWarning ,
1076
+ match = '.transOffset. without .offsets. has no effect' ):
1077
+ mcollections .Collection ([],
1078
+ transOffset = mtransforms .IdentityTransform ())
1079
+
1075
1080
skew = mtransforms .Affine2D ().skew (2 , 2 )
1076
- init = mcollections .Collection ([], transOffset = skew )
1081
+ init = mcollections .Collection ([], offsets = [], transOffset = skew )
1077
1082
1078
1083
late = mcollections .Collection ([])
1079
1084
late .set_offset_transform (skew )
You can’t perform that action at this time.
0 commit comments