# Additional tick marks in a LogLogPlot

In the following mwe, I have a loglogplot. I want to display the tick positions where the horizontal and vertical lines meet the axes.

f[x_] = 10^(-10)*Log[x];

LogLogPlot[f[x], {x, 10^4, 10^7},
Epilog -> {
Line[{{Log[5*10^6], Log[f[5*10^3]]}, {Log[5*10^6],
Log[f[5*10^6]]}}],
Line[{{Log[5*10^3], Log[f[5*10^6]]}, {Log[5*10^6],
Log[f[5*10^6]]}}]}]


I found a related post, but the additional ticks there mess up with the other ticks. I want to keep the rest of my major and minor ticks the intact.

llp = LogLogPlot[f[x], {x, 10^4, 10^7},
Prolog -> {Line[{{Log[5*10^6], Log[f[5*10^3]]}, {Log[5*10^6], Log[f[5*10^6]]}}],
Line[{{Log[5*10^3], Log[f[5*10^6]]}, {Log[5*10^6], Log[f[5*10^6]]}}]}];


Extract the ticks used in llp using AbsoluteOptions:

{tx, ty} = Ticks /. AbsoluteOptions[llp, Ticks];


or generate them using the function ChartingScaledTicks

{tx2, ty2} = ChartingScaledTicks[{Log, Exp}][##, {6, 6}] & @@@ PlotRange[llp];


Specify the new ticks:

newxtick = {N@Log[5*10^6], Style[N@5*10^6, Red], {0.03, 0.01},
{Red, AbsoluteThickness[3]}};

newytick = {N@Log[f[5*10^6]], Style[N@f[5*10^6], Red], {0.03, 0.01},
{Red, AbsoluteThickness[3]}};


Add them to the original ticks list:

ticks = {DeleteDuplicatesBy[First]@Prepend[tx2, newxtick],
DeleteDuplicatesBy[First]@Prepend[ty2, newytick]};


Use Show with the option Ticks -> ticks:

Show[llp, Ticks -> ticks, ImageSize -> Large]


Try this:

f[x_] = 10^(-10)*Log[x];

Plot[f[x], {x, 10^4, 10^7}, ScalingFunctions -> {"Log", "Log"},
Ticks -> {{5.*10^4, 5.*10^5, 5.*10^6} /.
x_?NumberQ -> {x, ScientificForm[x]}, {1.0*10^-9,
1.25*10^-9, {f[5*10^6] // N,
NumberForm[f[5*10^6] // N, {2, 1}]}}},
Epilog -> {Line[{{Log[5*10^6], Log[f[5*10^3]]}, {Log[5*10^6],
Log[f[5*10^6]]}}],
Line[{{Log[5*10^3], Log[f[5*10^6]]}, {Log[5*10^6],
Log[f[5*10^6]]}}]}]


Have fun!

• Yes, but as I said above I cannot afford to change the positions of the original ticks in my plot. I just want the extra ticks at the position of intersection of the lines with the axes. Thanks – smj Jan 30 '20 at 9:31
• If you read my answer you see how one can include the ticks one needs. Just as I did, you can include those ticks you want and fix for them the format you wish. Have a look at Menu/Help/WolframDocumentation/Ticks/Scope/TicksPositionandLabeling and there example Nr. 5 – Alexei Boulbitch Jan 30 '20 at 9:46