@@ -435,6 +435,14 @@ def draw(self, renderer):
435
435
# add the projection matrix to the renderer
436
436
self .M = self .get_proj ()
437
437
props3d = {
438
+ # To raise a deprecation, we need to wrap the attribute in a
439
+ # function, but binding that to an instance does not work, as you
440
+ # would end up with an instance-specific method. Properties are
441
+ # class-level attributes which *are* functions, so we do that
442
+ # instead.
443
+ # This creates deprecated properties for the attributes listed
444
+ # below, and they are temporarily attached to the _class_ in the
445
+ # `_setattr_cm` call.
438
446
name : cbook .deprecated ('3.4' , name = name ,
439
447
alternative = f'self.axes.{ name } ' )(
440
448
property (lambda self , _value = getattr (self , name ): _value ))
@@ -443,8 +451,18 @@ def draw(self, renderer):
443
451
444
452
with cbook ._setattr_cm (type (renderer ), ** props3d ):
445
453
def do_3d_projection (artist ):
454
+ """
455
+ Call `do_3d_projection` on an *artist*, and warn if passing
456
+ *renderer*.
457
+
458
+ For our Artists, never pass *renderer*. For external Artists,
459
+ in lieu of more complicated signature parsing, always pass
460
+ *renderer* and raise a warning.
461
+ """
462
+
446
463
if artist .__module__ == 'mpl_toolkits.mplot3d.art3d' :
447
- # Our 3D Artists have deprecated the renderer parameter.
464
+ # Our 3D Artists have deprecated the renderer parameter, so
465
+ # avoid passing it to them.
448
466
return artist .do_3d_projection ()
449
467
450
468
cbook .warn_deprecated (
0 commit comments