# Scale ticks of a LogLinear Plot

I have LogLinear plots for which I want to scale the ticks on the x-axis. The following MWE, which works for the linear plot is showing ticks at the wrong positions for the LogLinear plot

Clear[plot];

plot = LogLinearPlot[Erf[x], {x, 1, 100}]
scalefact= 10^(-10);
newticks = {#, scalefact #} & /@ Range[1, 100];
Show[plot, Ticks -> {newticks, Automatic}]


Since I already have the plots I would not like to scale the x-axis, I just want to change the tick specifications. Thanks.

You can take x-Ticks from plot either with:

oldticks = ChartingScaledTicks[{Log, Exp}][Log@1, Log@100, {6,6}]


or with:

oldticks = (Ticks /. AbsoluteOptions[plot, Ticks])[[1]]


Now change labels:

Show[plot,
Ticks -> {oldticks /. {a_?NumericQ, b_?NumericQ, c__} :> {a, scalefact b, c},
Automatic}]


EDIT

newTicks = {Log[#], scalefact #} & /@ {1., 10., 100.}
newTicksEmpty = {Log[#], Spacer[0]} & /@ {1., 10., 100.}
Show[plot,
FrameTicks -> {{Automatic, Automatic}, {newTicks, newTicksEmpty}},
Frame -> True]


Minor ticks can be added with Subdivide of the corresponding interval and using technique as for newTicksEmpty:

minor = {Log@#, Spacer[0], {0.005, 0}} & /@
Join[Subdivide[1, 10., 9], Subdivide[10, 100., 9]]

Show[plot,
FrameTicks -> {{Automatic, Automatic}, {Join[newTicks, minor],
Join[newTicksEmpty, minor]}}, Frame -> True]


• Thanks for the answer. The ChartingScaledTIcks works for me. Just another related query. How do I control the positioning of the major and minor ticks. For instance, in the above example I want the ticks to appear only at 10^(-10), 10^(-9) and 10^(-8).
– smj
Nov 27, 2019 at 9:46
– Alx
Nov 27, 2019 at 12:13
• This is exactly what I wanted. Thank you once again.
– smj
Nov 27, 2019 at 12:37
newticks = Map[{#, # *1.*10^-10} &, Range[1, 100]];

which only differs from your definition by a factor 1..