@@ -87,11 +87,10 @@ def __init__(
87
87
super ().__init__ ()
88
88
89
89
if gridOn is None :
90
- if major and ( mpl .rcParams ['axes.grid.which' ]
91
- in ('both' , 'major' )):
90
+ which = mpl .rcParams ['axes.grid.which' ]
91
+ if major and ( which in ('both' , 'major' )):
92
92
gridOn = mpl .rcParams ['axes.grid' ]
93
- elif (not major ) and (mpl .rcParams ['axes.grid.which' ]
94
- in ('both' , 'minor' )):
93
+ elif (not major ) and (which in ('both' , 'minor' )):
95
94
gridOn = mpl .rcParams ['axes.grid' ]
96
95
else :
97
96
gridOn = False
@@ -632,7 +631,7 @@ def __str__(self):
632
631
return "{}({},{})" .format (
633
632
type (self ).__name__ , * self .axes .transAxes .transform ((0 , 0 )))
634
633
635
- def __init__ (self , axes , * , pickradius = 15 ):
634
+ def __init__ (self , axes , * , pickradius = 15 , clear = True ):
636
635
"""
637
636
Parameters
638
637
----------
@@ -641,6 +640,8 @@ def __init__(self, axes, *, pickradius=15):
641
640
pickradius : float
642
641
The acceptance radius for containment tests. See also
643
642
`.Axis.contains`.
643
+ clear : bool, default: True
644
+ Whether to clear the Axis on creation.
644
645
"""
645
646
super ().__init__ ()
646
647
self ._remove_overlapping_locs = True
@@ -674,7 +675,12 @@ def __init__(self, axes, *, pickradius=15):
674
675
self ._major_tick_kw = dict ()
675
676
self ._minor_tick_kw = dict ()
676
677
677
- self .clear ()
678
+ if clear :
679
+ self .clear ()
680
+ else :
681
+ self .converter = None
682
+ self .units = None
683
+
678
684
self ._autoscale_on = True
679
685
680
686
@property
0 commit comments