# Scientific notations with negative powers for plotting

Plot[x^2, {x, 0, 100},Ticks -> {{#, ScientificForm@#} & /@ Range[0., 100., 30.], {#, ScientificForm@#} & /@ Range[0., 100^2, 1000.]}, PlotRange -> All];

PowerTicks[label_][min_, max_] :=Block[{min10, max10}, min10 = Floor[Log10[min]]; max10 = Ceiling[Log10[max]]; Join[Table[{10^i,If[label, Superscript[10, i], Spacer[{0, 0}]]}, {i, min10, max10}], Flatten[Table[{k 10^i,Spacer[{0, 0}], {0.005, 0.},{Thickness[0.001]}}, {i, min10,max10}, {k, 9}], 1]]] ListLogLogPlot[Range[20]^3, Frame -> True, FrameTicks -> {{PowerTicks[True],PowerTicks[False]}, {PowerTicks[True], PowerTicks[False]}}]

The above code works very well for the positive powers. Could some one please check it how does it change for the negative powers. More specific, on both axes the scales should be ranging {10^-5, 10^-4....10^0, 10^1, 10^2,...10^5}. Thanks!

The axes are scaled to the data. If only want to change the axes with the same data you may use PlotRange:

ListLogLogPlot[Range[20]^3, Frame -> True,
FrameTicks -> {{PowerTicks[True],
PowerTicks[False]}, {PowerTicks[True], PowerTicks[False]}},
PlotRange -> {{10^-5, 10^5}, {10^-5, 10^5}}]


However, MMA does this automatically if the data span this range. E.g.:

dat = Join[(1/Range[40])^3, Range[40]^3];
dat = Transpose[{dat, dat}];
ListLogLogPlot[dat, Frame -> True,
FrameTicks -> {{PowerTicks[True],
PowerTicks[False]}, {PowerTicks[True], PowerTicks[False]}}]


• Thanks, it worked! My data includes the negative powers, so the the second option is relevent to me. By the way, how do you get the tick markers more darker in your images above. Mine are the same, but dimmer. – SciJewel Feb 27 at 17:25
• Well, I did not do anything and did not even realize it. But in between you edited your code, PowerTicks is no more working. – Daniel Huber Feb 27 at 17:37
• So, you are not using PowerTicks from my code above? – SciJewel Feb 27 at 18:47
• Yes, I am using PowerTicks but if I try my code it does no more run. And you changed your code. Therefore I assume you changed PowerTicks as I did not change my part. – Daniel Huber Feb 27 at 19:16
• Hubel: No, I have not changed anything, I guess someone else might have changed it. – SciJewel Feb 27 at 20:24