@@ -846,36 +846,14 @@ def get_children(self):
846846return [self .label ,self .offsetText ,
847847* self .get_major_ticks (),* self .get_minor_ticks ()]
848848
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 ):
859850self ._major_tick_kw .clear ()
860- if keep_tick_and_label_visibility :
861- self ._major_tick_kw .update (backup )
862851self ._major_tick_kw ['gridOn' ]= (
863852mpl .rcParams ['axes.grid' ]and
864853mpl .rcParams ['axes.grid.which' ]in ('both' ,'major' ))
865854
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 ):
876856self ._minor_tick_kw .clear ()
877- if keep_tick_and_label_visibility :
878- self ._minor_tick_kw .update (backup )
879857self ._minor_tick_kw ['gridOn' ]= (
880858mpl .rcParams ['axes.grid' ]and
881859mpl .rcParams ['axes.grid.which' ]in ('both' ,'minor' ))
@@ -892,8 +870,6 @@ def clear(self):
892870 - major and minor grid
893871 - units
894872 - registered callbacks
895-
896- This does not reset tick and tick label visibility.
897873 """
898874
899875self .label .set_text ('' )# self.set_label_text would change isDefault_
@@ -905,8 +881,12 @@ def clear(self):
905881signals = ["units" ,"units finalize" ])
906882
907883# whether the grids are on
908- self ._reset_major_tick_kw (keep_tick_and_label_visibility = True )
909- self ._reset_minor_tick_kw (keep_tick_and_label_visibility = True )
884+ self ._major_tick_kw ['gridOn' ]= (
885+ mpl .rcParams ['axes.grid' ]and
886+ mpl .rcParams ['axes.grid.which' ]in ('both' ,'major' ))
887+ self ._minor_tick_kw ['gridOn' ]= (
888+ mpl .rcParams ['axes.grid' ]and
889+ mpl .rcParams ['axes.grid.which' ]in ('both' ,'minor' ))
910890self .reset_ticks ()
911891
912892self .converter = None