# The implementation of "SignedLog" Scaling Function of Plot

I recently noticed that the Plot function has a new embeded scaling function SignedLog, which looks like the matplotlib symlog. The implementation of symlog-like function is discussed a lot in this forum, such as symlog-like-plot-with-a-mixed-log-linear-log-scale, how-to-get-negative-values-of-function-on-y-axis-when-i-am-plotting-as-logplot. Now that Mathematica has its own implementation, I would like to know exactly what function it used.

On a side note, there seems to be some bugs when Around and IntervalMarkers->"Fences" (or "Bars") are used along with this.

Edit:
I figured it out just after I posted this question. So see details in the answer below. Any other thoughts on this topic is welcomed.

• Oh heck yeah. Thanks for finding this! Feb 15, 2022 at 21:56

My guess is it's not symlog described in the first post:

symlog = {Function[x, Sign[x] (Log[Abs[x] + 1])],
Function[y, Sign[y] (Exp[Abs[y]] - 1)]};


I tested it with the following example:

Show[Plot[x, {x, -10, 10}, ScalingFunctions -> "SignedLog",
PlotLabels -> "SignedLog"],
Plot[x, {x, -10, 10}, ScalingFunctions -> symlog,
PlotStyle -> Orange, PlotLabels -> "symlog"], PlotRange -> All]


Although it looks like

symlog10 = {Function[x, Sign[x] (Log10[Abs[x] + 1])],
Function[y, Sign[y] (10^Abs[y] - 1)]};


The manual also indicated another use (ScalingFunctions -> {"SignedLog", a}):

Show[Plot[x, {x, -10, 10}, ScalingFunctions -> {"SignedLog", 1/100},
PlotLabels -> "{SignedLog,1/100}"],
Plot[x, {x, -10, 10}, ScalingFunctions -> symlog10,
PlotStyle -> {Dashed, Orange}, PlotLabels -> "symlog10"],
PlotRange -> All]


Seems like the scaled symlog works:

symlog10a[a_] := {Function[x, Sign[x] (Log10[Abs[x]/a + 1])],
Function[y, Sign[y] (10^Abs[y] - 1) a]};

Show[Plot[x, {x, -10, 10}, ScalingFunctions -> {"SignedLog",
1/100},
PlotLabels -> "{SignedLog,1/100}"],
Plot[x, {x, -10, 10}, ScalingFunctions -> "SignedLog",
PlotLabels -> "{SignedLog}"],
Plot[x, {x, -10, 10}, ScalingFunctions -> symlog10a[1/100],
PlotStyle -> {Dashed, Orange}, PlotLabels -> "symlog10"],
PlotRange -> All]


EDIT: Looks like there is a Floor function in SignedLog. The corresponding symlog10 should be:

symlog10aFloor[a_] := With[{aa=10^Floor@Log10@a},{Function[x, Sign[x]
(Log10[Abs[x]/aa + 1])],
Function[y, Sign[y] (10^Abs[y] - 1) aa]}];

Show[Plot[x, {x, -10, 10}, ScalingFunctions -> {"SignedLog",     7/100},
PlotLabels -> "{SignedLog,7/100}"],
Plot[x, {x, -10, 10}, ScalingFunctions -> "SignedLog",
PlotLabels -> "{SignedLog}"],
Plot[x, {x, -10, 10}, ScalingFunctions -> symlog10aFloor[7/100],
PlotStyle -> {Dashed, Orange}, PlotLabels -> "symlog10Floor"],
Plot[x, {x, -10, 10}, ScalingFunctions -> symlog10a[5/100],
PlotStyle -> {Red}, PlotLabels -> "symlog10_old"], PlotRange -> All]


such that