|
|
|
|
|
by leeoniya
766 days ago
|
|
> that turns into a linear scale around zero how does this actually work? afaik, there is no log() fn that you can run which "becomes linear". i guess you can wrap a call to log() in another fn that simply does linear scaling below the defined threshold, but it's not a smooth transition without a bunch of extra [possibly slow] smoothing code. what you're describing is exactly how a straight call to Math.asinh() behaves, and what i have implemented in the above demo. |
|
In the example from matplotlib I linked in the earlier comment they call out that the symlog transform has a discontinous gradient at the a's, and that the asinh transform can be used instead if that's a problem.
Edit: On reflection it's probably not entirely correct to talk about it as choosing an appropriate c. Since that transform seems to kinda break apart around a=1. Simpler to consider it a matter of plotting on a logarithmic scale down to some value. Then continuing the plot on a linear scale until you reach the negative value on the other side and then plotting on a negative logarithmic scale (-log(|x|)).