You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reuse scale from sharing axis when calling cla(). (#12831)
The previous code, which called
mscale.scale_factory(self._sharex.xaxis.get_scale(), self.xaxis)
assumed that this would be sufficient to "copy" a scale object, but in
fact this fails to copy e.g. the base of log scales, so the log base
would be reset to its default (=10).
Instead, just share the scale object, as is done when *creating* a
shared axis.
This implies that Scales should be reusable across multiple Axis, hence
the added note in the docstring. (Note that right now, LogScale objects
use the info of whether the axis is an `x` or a `y` axis to decide
whether to request arguments named `basex` or `basey`; it would not
be too difficult to change the signature of LogScale to always take a
`base` argument instead (which would be a more reasonable signature
too...); the main problem would be the API difference with `loglog(...,
basex=..., basey=...)` -- but on the other hand it's not as if Scales
were commonly instantiated by end users (for example one cannot even
pass a Scale object to `set_scale`(!))).
0 commit comments