@@ -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
@@ -189,21 +189,6 @@ def set_functions(self, functions):
189
189
If a transform is supplied, then the transform must have an
190
190
inverse.
191
191
"""
192
-
193
- if self ._orientation == 'x' :
194
- set_scale = self .set_xscale
195
- parent_scale = self ._parent .get_xscale ()
196
- else :
197
- set_scale = self .set_yscale
198
- parent_scale = self ._parent .get_yscale ()
199
- # we need to use a modified scale so the scale can receive the
200
- # transform. Only types supported are linear and log10 for now.
201
- # Probably possible to add other transforms as a todo...
202
- if parent_scale == 'log' :
203
- defscale = 'functionlog'
204
- else :
205
- defscale = 'function'
206
-
207
192
if (isinstance (functions , tuple ) and len (functions ) == 2 and
208
193
callable (functions [0 ]) and callable (functions [1 ])):
209
194
# make an arbitrary convert from a two-tuple of functions
@@ -216,8 +201,7 @@ def set_functions(self, functions):
216
201
'must be a two-tuple of callable functions '
217
202
'with the first function being the transform '
218
203
'and the second being the inverse' )
219
- # need to invert the roles here for the ticks to line up.
220
- set_scale (defscale , functions = self ._functions [::- 1 ])
204
+ self ._set_scale ()
221
205
222
206
def draw (self , renderer = None , inframe = False ):
223
207
"""
@@ -246,8 +230,6 @@ def _set_scale(self):
246
230
set_scale = self .set_yscale
247
231
if pscale == self ._parentscale :
248
232
return
249
- else :
250
- self ._parentscale = pscale
251
233
252
234
if pscale == 'log' :
253
235
defscale = 'functionlog'
@@ -265,6 +247,9 @@ def _set_scale(self):
265
247
if self ._ticks_set :
266
248
self ._axis .set_major_locator (mticker .FixedLocator (ticks ))
267
249
250
+ # If the parent scale doesn't change, we can skip this next time.
251
+ self ._parentscale = pscale
252
+
268
253
def _set_lims (self ):
269
254
"""
270
255
Set the limits based on parent limits and the convert method
0 commit comments