@@ -318,32 +318,24 @@ def __init__(self, *args, **kwargs):
318
318
raise ValueError ("FloatingAxes requires grid_helper argument" )
319
319
if not hasattr (grid_helper , "get_boundary" ):
320
320
raise ValueError ("grid_helper must implement get_boundary method" )
321
-
322
- self ._axes_class_floating .__init__ (self , * args , ** kwargs )
323
-
321
+ super ().__init__ (* args , ** kwargs )
324
322
self .set_aspect (1. )
325
323
self .adjust_axes_lim ()
326
324
327
325
def _gen_axes_patch (self ):
328
326
# docstring inherited
329
- grid_helper = self .get_grid_helper ()
330
- t = grid_helper .get_boundary ()
331
- return mpatches .Polygon (t )
327
+ return mpatches .Polygon (self .get_grid_helper ().get_boundary ())
332
328
333
329
def cla (self ):
334
- self ._axes_class_floating .cla (self )
335
- # HostAxes.cla(self)
330
+ super ().cla ()
336
331
self .patch .set_transform (self .transData )
337
-
338
- patch = self ._axes_class_floating ._gen_axes_patch (self )
339
- patch .set_figure (self .figure )
340
- patch .set_visible (False )
341
- patch .set_transform (self .transAxes )
342
-
343
- self .patch .set_clip_path (patch )
344
- self .gridlines .set_clip_path (patch )
345
-
346
- self ._original_patch = patch
332
+ # The original patch is not in the draw tree; it is only used for
333
+ # clipping purposes.
334
+ orig_patch = super ()._gen_axes_patch ()
335
+ orig_patch .set_figure (self .figure )
336
+ orig_patch .set_transform (self .transAxes )
337
+ self .patch .set_clip_path (orig_patch )
338
+ self .gridlines .set_clip_path (orig_patch )
347
339
348
340
def adjust_axes_lim (self ):
349
341
grid_helper = self .get_grid_helper ()
@@ -363,8 +355,7 @@ def adjust_axes_lim(self):
363
355
@functools .lru_cache (None )
364
356
def floatingaxes_class_factory (axes_class ):
365
357
return type ("Floating %s" % axes_class .__name__ ,
366
- (FloatingAxesBase , axes_class ),
367
- {'_axes_class_floating' : axes_class })
358
+ (FloatingAxesBase , axes_class ), {})
368
359
369
360
370
361
FloatingAxes = floatingaxes_class_factory (
0 commit comments