@@ -82,7 +82,7 @@ def __init__(self, parent, orientation,
82
82
self ._axis = self .yaxis
83
83
self ._locstrings = ['right' , 'left' ]
84
84
self ._otherstrings = ['top' , 'bottom' ]
85
- self ._parentscale = self . _axis . get_scale ()
85
+ self ._parentscale = None
86
86
# this gets positioned w/o constrained_layout so exclude:
87
87
self ._layoutbox = None
88
88
self ._poslayoutbox = None
@@ -215,23 +215,7 @@ def set_functions(self, functions):
215
215
216
216
If a transform is supplied, then the transform must have an
217
217
inverse.
218
-
219
218
"""
220
-
221
- if self ._orientation == 'x' :
222
- set_scale = self .set_xscale
223
- parent_scale = self ._parent .get_xscale ()
224
- else :
225
- set_scale = self .set_yscale
226
- parent_scale = self ._parent .get_yscale ()
227
- # we need to use a modified scale so the scale can receive the
228
- # transform. Only types supported are linear and log10 for now.
229
- # Probably possible to add other transforms as a todo...
230
- if parent_scale == 'log' :
231
- defscale = 'functionlog'
232
- else :
233
- defscale = 'function'
234
-
235
219
if (isinstance (functions , tuple ) and len (functions ) == 2 and
236
220
callable (functions [0 ]) and callable (functions [1 ])):
237
221
# make an arbitrary convert from a two-tuple of functions
@@ -244,7 +228,7 @@ def set_functions(self, functions):
244
228
'must be a two-tuple of callable functions '
245
229
'with the first function being the transform '
246
230
'and the second being the inverse' )
247
- set_scale ( defscale , functions = self ._functions )
231
+ self ._set_scale ( )
248
232
249
233
def draw (self , renderer = None , inframe = False ):
250
234
"""
@@ -275,8 +259,6 @@ def _set_scale(self):
275
259
set_scale = self .set_yscale
276
260
if pscale == self ._parentscale :
277
261
return
278
- else :
279
- self ._parentscale = pscale
280
262
281
263
if pscale == 'log' :
282
264
defscale = 'functionlog'
@@ -293,6 +275,9 @@ def _set_scale(self):
293
275
if self ._ticks_set :
294
276
self ._axis .set_major_locator (FixedLocator (ticks ))
295
277
278
+ # If the parent scale doesn't change, we can skip this next time.
279
+ self ._parentscale = pscale
280
+
296
281
def _set_lims (self ):
297
282
"""
298
283
Set the limits based on parent limits and the convert method
0 commit comments