@@ -846,36 +846,14 @@ def get_children(self):
846
846
return [self .label , self .offsetText ,
847
847
* self .get_major_ticks (), * self .get_minor_ticks ()]
848
848
849
- def _reset_major_tick_kw (self , keep_tick_and_label_visibility = False ):
850
- """
851
- Reset major tick params to defaults.
852
-
853
- Shared subplots pre-configure tick and label visibility. To keep this
854
- beyond an Axis.clear() operation, we may
855
- *keep_tick_and_label_visibility*.
856
- """
857
- backup = {name : value for name , value in self ._major_tick_kw .items ()
858
- if name in ['tick1On' , 'tick2On' , 'label1On' , 'label2On' ]}
849
+ def _reset_major_tick_kw (self ):
859
850
self ._major_tick_kw .clear ()
860
- if keep_tick_and_label_visibility :
861
- self ._major_tick_kw .update (backup )
862
851
self ._major_tick_kw ['gridOn' ] = (
863
852
mpl .rcParams ['axes.grid' ] and
864
853
mpl .rcParams ['axes.grid.which' ] in ('both' , 'major' ))
865
854
866
- def _reset_minor_tick_kw (self , keep_tick_and_label_visibility = False ):
867
- """
868
- Reset minor tick params to defaults.
869
-
870
- Shared subplots pre-configure tick and label visibility. To keep this
871
- beyond an Axis.clear() operation, we may
872
- *keep_tick_and_label_visibility*.
873
- """
874
- backup = {name : value for name , value in self ._minor_tick_kw .items ()
875
- if name in ['tick1On' , 'tick2On' , 'label1On' , 'label2On' ]}
855
+ def _reset_minor_tick_kw (self ):
876
856
self ._minor_tick_kw .clear ()
877
- if keep_tick_and_label_visibility :
878
- self ._minor_tick_kw .update (backup )
879
857
self ._minor_tick_kw ['gridOn' ] = (
880
858
mpl .rcParams ['axes.grid' ] and
881
859
mpl .rcParams ['axes.grid.which' ] in ('both' , 'minor' ))
@@ -892,8 +870,6 @@ def clear(self):
892
870
- major and minor grid
893
871
- units
894
872
- registered callbacks
895
-
896
- This does not reset tick and tick label visibility.
897
873
"""
898
874
self .label ._reset_visual_defaults ()
899
875
self .offsetText ._reset_visual_defaults ()
@@ -908,8 +884,12 @@ def clear(self):
908
884
signals = ["units" , "units finalize" ])
909
885
910
886
# whether the grids are on
911
- self ._reset_major_tick_kw (keep_tick_and_label_visibility = True )
912
- self ._reset_minor_tick_kw (keep_tick_and_label_visibility = True )
887
+ self ._major_tick_kw ['gridOn' ] = (
888
+ mpl .rcParams ['axes.grid' ] and
889
+ mpl .rcParams ['axes.grid.which' ] in ('both' , 'major' ))
890
+ self ._minor_tick_kw ['gridOn' ] = (
891
+ mpl .rcParams ['axes.grid' ] and
892
+ mpl .rcParams ['axes.grid.which' ] in ('both' , 'minor' ))
913
893
self .reset_ticks ()
914
894
915
895
self .converter = None
0 commit comments