# How to get rid of 0.000 and change 5.*10^n to 3*10^n on Log Plots?

Using Version 13.1.0.0 (Edit: MacOS BigSur Version 11.6, Hardware M1 chip)

In order to show some Log (or LogLog) plot features that I find annoying, here is some code:

A=3/2;B=1/1000;G=1;
{Slider[Dynamic[G],{1/10,8}],"G"->Dynamic[G],"\n",Slider[Dynamic[A],{1/2,2}],"A"->Dynamic[A],"\n",Slider[Dynamic[B],{1/10000,1/100}],"B"->Dynamic[B],"\n",Dynamic[LogLogPlot[
Evaluate[ B/(G Gamma[G+1] Zeta[1+G](2-2^-G)) {Log[1+A/(-1+E^(B t))]^G,A^G E^(-B G t)}],{t,0,3000},PlotRange->{{0.01,Full},{0,Full}},WorkingPrecision->20,ImageSize->Medium]]}


Please notice that the code this generates shows 0.000 rather than 0.001 on the y-axis and show numerical values at 5.x 10$$^n$$ rather than 3 x 10$$^n$$, where both the decimal points are unneeded and the divisions at 5 times ten to a power results in collisions a lot sooner than at 3 times ten to a power because N[Log10[3]] is 0.477121 or very close to 0.5 on a Log10 plot, whereas N[Log10[5]] is 0.69897, and not close to 0.5.

Are there any fixes for these annoying features that do not involve yards of Tick coding?

Notice the positions of the numbers NumberLinePlot[{Log10[1], Log10[3], Log10[5], Log10[10]}]

Re: Yards of tick code. For example,

FrameTicks -> {{{3, 3, {0, .01}}, {4, "", {0, .01}}, {5,
"", {0, .01}}, {6, "", {0, .01}}, {7, "", {0, .01}}, {8,
"", {0, .01}}, {9, "", {0, .01}}, {10, 10, {0, .015}}, {20,
"", {0, .01}}, {30, 30, {0, .01}}, {40, "", {0, .01}}, {50,
"", {0, .01}}, {60, "", {0, .01}}, {70, "", {0, .01}}, {80,
"", {0, .01}}, {90, "", {0, .01}}, {100, 100, {0, .015}}, {200,
"", {0, .01}}, {300, 300, {0, .01}}, {400, "", {0, .01}}, {500,
"", {0, .01}}, {600, "", {0, .01}}, {700, "", {0, .01}}, {800,
"", {0, .01}}, {900, "", {0, .01}}, {1000,
1000, {0, .015}}, {2000, "", {0, .01}}, {3000,
3000, {0, .01}}, {4000, "", {0, .01}}, {5000, "", {0, .01}}},
Automatic}


To format an x-axis like the following:

PS, I put this in as bugs even though this has not been vetted because I do not need to have someone verify that $$0.000\neq0.001$$, i.e., seeing is believing.

Edit On 2023-08-02 I received notification from Wolfram that Mathematica 13.3.1.0 has fixed the M1 chip code bug. Indeed, the same code as above now displays 0.001 rather than 0.000 on the $$y$$-axis.

• I'm running 13.1.0.0 on a mac, and I see 0.001 where your picture shows 0.000. Commented Oct 11, 2022 at 20:30
• 13.1.0.0 on Windows 10 also produces 0.001 rather than 0.000. What operating system are you using?
– JimB
Commented Oct 11, 2022 at 21:43
• @lericr I am using MacOS BigSur Version 11.6, Hardware M1 chip.
– Carl
Commented Oct 12, 2022 at 1:03
• @JimB So I tried MacBook Pro, macOS 11.5.2 Mathematica 12.3.0.0 and it shows 0.001 for the same code that on my iMac computer as produces 0.000. So no, I can't explain why that is.
– Carl
Commented Oct 12, 2022 at 1:10
• So, the first issue seems to be M1 specific. If I understand, there are two other issues (which, by the way, might warrant breaking up this question to separate the bug): (1) the format of the tick labels, specifically the superfluous decimal point, and (2) the choice of which ticks to label. I believe you can address both of these with the Ticks option. FindDivisions is a helpful function. Creating your own helper function for formatting the tick labels is usually easy. But I don't know what you consider "yards of Tick coding". Commented Oct 12, 2022 at 14:29

Based on the update, and applying some simplification so we can focus on the ticks, here is an approach that computes the option for the ticks.

TickSpec =
{Join[
Table[{3*10^i, StringForm["3e", i], .01}, {i, 0, Floor[Log10[3000]]}],
Table[{1*10^(i + 1), StringForm["1e", i + 1], .02}, {i, 0, Floor[Log10[3000]]}]], {}};
LogLogPlot[Log10[x], {x, 0, 3000}, Ticks -> TickSpec]


You could parameterize this to get rid of the hard-coded 3000.

I should add that I didn't see in your examples why using FrameTicks was necessary, so I just used Ticks. But a similar treatment could be used for FrameTicks, although the format is slightly different.

• I approved it. Yeah, I wasn't really careful to get the exact ticks you wanted. I was focusing on how to specify the structure of the option. And if you really did want some unlabeled ticks, that could be worked in as well. As long as you have a well-specified rule for which ticks should appear and how to label them, you should be able to avoid "yards of tick coding". Commented Oct 12, 2022 at 16:45
• I should be able to take it from here, thanks.
– Carl
Commented Oct 12, 2022 at 17:00
• However, the bug is still a bug.
– Carl
Commented Oct 12, 2022 at 17:07
• Agreed. Did you report it? Commented Oct 12, 2022 at 17:09
• No. I can, just not today.
– Carl
Commented Oct 12, 2022 at 17:11