@@ -62,7 +62,7 @@ def __init__(self, parent, orientation,
62
62
self ._axis = self .yaxis
63
63
self ._locstrings = ['right' , 'left' ]
64
64
self ._otherstrings = ['top' , 'bottom' ]
65
- self ._parentscale = self . _axis . get_scale ()
65
+ self ._parentscale = None
66
66
# this gets positioned w/o constrained_layout so exclude:
67
67
self ._layoutbox = None
68
68
self ._poslayoutbox = None
@@ -195,21 +195,6 @@ def set_functions(self, functions):
195
195
If a transform is supplied, then the transform must have an
196
196
inverse.
197
197
"""
198
-
199
- if self ._orientation == 'x' :
200
- set_scale = self .set_xscale
201
- parent_scale = self ._parent .get_xscale ()
202
- else :
203
- set_scale = self .set_yscale
204
- parent_scale = self ._parent .get_yscale ()
205
- # we need to use a modified scale so the scale can receive the
206
- # transform. Only types supported are linear and log10 for now.
207
- # Probably possible to add other transforms as a todo...
208
- if parent_scale == 'log' :
209
- defscale = 'functionlog'
210
- else :
211
- defscale = 'function'
212
-
213
198
if (isinstance (functions , tuple ) and len (functions ) == 2 and
214
199
callable (functions [0 ]) and callable (functions [1 ])):
215
200
# make an arbitrary convert from a two-tuple of functions
@@ -222,8 +207,7 @@ def set_functions(self, functions):
222
207
'must be a two-tuple of callable functions '
223
208
'with the first function being the transform '
224
209
'and the second being the inverse' )
225
- # need to invert the roles here for the ticks to line up.
226
- set_scale (defscale , functions = self ._functions [::- 1 ])
210
+ self ._set_scale ()
227
211
228
212
def draw (self , renderer = None , inframe = False ):
229
213
"""
@@ -252,8 +236,6 @@ def _set_scale(self):
252
236
set_scale = self .set_yscale
253
237
if pscale == self ._parentscale :
254
238
return
255
- else :
256
- self ._parentscale = pscale
257
239
258
240
if pscale == 'log' :
259
241
defscale = 'functionlog'
@@ -271,6 +253,9 @@ def _set_scale(self):
271
253
if self ._ticks_set :
272
254
self ._axis .set_major_locator (mticker .FixedLocator (ticks ))
273
255
256
+ # If the parent scale doesn't change, we can skip this next time.
257
+ self ._parentscale = pscale
258
+
274
259
def _set_lims (self ):
275
260
"""
276
261
Set the limits based on parent limits and the convert method
0 commit comments