@@ -980,21 +980,8 @@ def cla(self):
980
980
self .xaxis .minor = self ._sharex .xaxis .minor
981
981
x0 , x1 = self ._sharex .get_xlim ()
982
982
self .set_xlim (x0 , x1 , emit = False , auto = None )
983
-
984
- # Save the current formatter/locator so we don't lose it
985
- majf = self ._sharex .xaxis .get_major_formatter ()
986
- minf = self ._sharex .xaxis .get_minor_formatter ()
987
- majl = self ._sharex .xaxis .get_major_locator ()
988
- minl = self ._sharex .xaxis .get_minor_locator ()
989
-
990
- # This overwrites the current formatter/locator
991
- self .xaxis ._set_scale (self ._sharex .xaxis .get_scale ())
992
-
993
- # Reset the formatter/locator
994
- self .xaxis .set_major_formatter (majf )
995
- self .xaxis .set_minor_formatter (minf )
996
- self .xaxis .set_major_locator (majl )
997
- self .xaxis .set_minor_locator (minl )
983
+ self .xaxis ._scale = mscale .scale_factory (
984
+ self ._sharex .xaxis .get_scale (), self .xaxis )
998
985
else :
999
986
self .xaxis ._set_scale ('linear' )
1000
987
try :
@@ -1007,21 +994,8 @@ def cla(self):
1007
994
self .yaxis .minor = self ._sharey .yaxis .minor
1008
995
y0 , y1 = self ._sharey .get_ylim ()
1009
996
self .set_ylim (y0 , y1 , emit = False , auto = None )
1010
-
1011
- # Save the current formatter/locator so we don't lose it
1012
- majf = self ._sharey .yaxis .get_major_formatter ()
1013
- minf = self ._sharey .yaxis .get_minor_formatter ()
1014
- majl = self ._sharey .yaxis .get_major_locator ()
1015
- minl = self ._sharey .yaxis .get_minor_locator ()
1016
-
1017
- # This overwrites the current formatter/locator
1018
- self .yaxis ._set_scale (self ._sharey .yaxis .get_scale ())
1019
-
1020
- # Reset the formatter/locator
1021
- self .yaxis .set_major_formatter (majf )
1022
- self .yaxis .set_minor_formatter (minf )
1023
- self .yaxis .set_major_locator (majl )
1024
- self .yaxis .set_minor_locator (minl )
997
+ self .yaxis ._scale = mscale .scale_factory (
998
+ self ._sharey .yaxis .get_scale (), self .yaxis )
1025
999
else :
1026
1000
self .yaxis ._set_scale ('linear' )
1027
1001
try :
0 commit comments