# Minor Log ticks on X-axis of DensityPlot

Could anyone help me to add the minor Log ticks to the X-axis of this Plot? Thank you so much!

DensityPlot[
20*y/(0.2 y + 0.8 x), {x, 1/10^10, 1/10^2}, {y, 1/10^9, 1/10^6},
ScalingFunctions -> {"Log", "Log"}, Ticks -> {Automatic},
ColorFunction -> "Rainbow"]


I've tried many ways but none of them worked out. I'm still learning this. Thank you.

dp = DensityPlot[20*y/(0.2 y + 0.8 x), {x, 1/10^10, 1/10^2}, {y, 1/10^9, 1/10^6},
ScalingFunctions -> {"Log", "Log"}, ColorFunction -> "Rainbow"];


Post-process dp to change the default number of major and minor ticks ({6,6}) to {8,6} for the bottom and top frames:

Replace[dp, {vt : {_, _}, {bt : ChartingScaledTicks[{Log, Exp}],
tt_}} :> {vt, {bt[#, #2, {8, 6}] &, tt[#, #2, {8, 6}] &}}, All]


Alternatively,

{leftticks, rightticks} = #[{Log, Exp}][Log[1/10^9], Log[1/10^6], {6, 6}] & /@
{ChartingScaledTicks, ChartingScaledFrameTicks};
{bottomticks, topticks} = #[{Log, Exp}][Log[1/10^10], Log[1/10^2], {8, 6}] & /@
{ChartingScaledTicks, ChartingScaledFrameTicks};

Show[dp, FrameTicks -> {{leftticks, rightticks}, {bottomticks, topticks}}]
`

• Thank you! X-axis scale of the second approach seems to be different. Sep 6, 2020 at 15:35
• @ShawnYoung, fixed now.
– kglr
Sep 6, 2020 at 15:42