This question is related Issue with number formatting in Bar Legend but does not fix my problem.
I have a contourplot with logarithmic scaling. Without trying to change anything, the barlegend looks as follows.
All I really want is to cut down the amount of digits to something consistent. Adapting the answer from the linked question, I did
myLegFunc[x_] :=
x /. {NumberForm[y_, {w_, z_}] :> ScientificForm[y, 4],
Row[{m_, Superscript[b_, e_]}, "\[Times]"] :>
NumberForm[m*b^e, {3, 2}]};
ContourPlot[...,
PlotLegends -> {LegendFunction -> myLegFunc},
ScalingFunctions -> "Log"]
So the fix from that old answer does not work for the values that would be notated in scientific notation anyway. I tried various functions to get it to a number that I could maybe use ScientificForm on but to no avail. My understanding of mathematica is poor, but it feels like the b^e part is a number, but m is not (in the myLegFunc function). I can get 10^{-6} instead of fraction over 100,000. I cannot get it to consider the whole expression as a number.
--
As per the request, this generates a similar issue. I cannot share the original function
ContourPlot[x^10, {x, 0, 5}, {y, 0, 5}, Axes -> True,
AxesLabel -> {x, y},
Sequence[ColorFunction -> "DeepSeaColors", Exclusions -> None],
Contours -> 10, PerformanceGoal -> "Quality", MaxRecursion -> 2,
PlotLegends -> Automatic, ScalingFunctions -> "Log"]
I have accepted an answer, there is still the issue that depending on settings (plotrange etc.) occasionally the last entry is formatted wrong. I cannot reproduce it in a minimal example, so I am giving up on this. Maybe it is something in my version of mathematica or specific to my data or ..







