New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symmetric Log scale: linscale < 1 ? #2288
Comments
This should be 1.4 milestone. I will try to solve this tomorrow. |
To be more exact, i think we should allow linscale to be smaller than 1, does anybody see why this is enforced. For the rest of the issuse: the smoothness depends not only one linscale, but also on linthresh. I also think it is a little bit late to change defaults. |
It is probably fine to just change the assert to > 0? |
milestoned an requested, but did not really read/understand what is going on. |
|
pinging @mdboom |
Closing as #3053 is merged. |
summary
explanation
currently one cannot set linscale values less than 1 in
Axes.set_{x,y}scale
due to
(matplotlib/scale.py:449) assert linscale >= 1.0
Setting linscale=1.0/math.log(base) (which is < 1.0) ensures that the symlog transformation function is smooth, i.e. its derivative is continuous at the border between linear and logarithmic regions. Smoothness of the transformation function is necessary&sufficient to avoid kinks in plots of smooth curves, i.e a smooth curve (with a continuous derivative) will be shown as a smooth curve. (see pictures). It makes sense then to set linscale=1.0/log(base) by default, or multiply it by this appropriate factor internally.
examples
(default)
(smooth, generated with patched matplotlib/scale.py sans 'assert linscale >= 1.0')
(kink)
generated with the following script
The text was updated successfully, but these errors were encountered: