# How can I make a NumberLineLogPlot'?

I have a piecewise function that is defined in logarithmic intervals, i.e., the different pieces are defined on

{{1. <= x <= 10}, {10 <= x <= 100}, {100 <= x <= 1000}}


I'd like to visualize the different domains on a number line. NumberLinePlot, of course, works, but it looks clumsy as the plot is fully dominated by the last domain an the first one is barely visible:

NumberLinePlot[{{1. <= x <= 10}, {10 <= x <= 100}, {100 <= x <= 1000}}, {x, 1, 1000}] So I can use something along the lines of

NumberLinePlot[
{{Log[10, 1] <= x <= Log[10, 10]},
{Log[10, 10] <= x <= Log[10, 100]},
{Log[10, 100] <= x <= Log[10, 1000]}},
{x, Log[10, 1], Log[10, 1000]}]


which results in a much more pleasantly balanced plot: However, now the number line ticks show the exponents — so in essence I'd like something like NumberLineLogPlot, but that doesn't exist.

I tried to recreate something like that by abusing LogLogPlot

Show[
LogLogPlot[#1, #2, PlotStyle -> #3] &,
{{1, 2, 4}, {x, #[[1, 1]], #[[1, 3]]} & /@ dx , {Red, Green, Blue}}],
PlotRange -> Automatic, Frame -> {{False, False}, {True, False}}] which is better in terms of the logarithmic x-axis but is quite clumsy in other ways.

Any ideas how to implement a NumberLineLogPlot nicely?

Use the option Ticks

intervals = {{1 <= x <= 10}, {10 <= x <= 100}, {100 <= x <= 1000}};

logIntervals = intervals /. {n_?NumericQ :> Log10[n]}

(* {{0 <= x <= 1}, {1 <= x <= 2}, {2 <= x <= 3}} *)

Ticks -> {({Log10[#], #} & /@
{1, 2, 5, 10, 20, 50, 100, 200, 500, 1000}), None}] • Nice one! I particularly like the trick with the patternreplacement for the Log[] – Oliver Jennrich Feb 3 '19 at 15:32

You can also transform intervals into a list of lists and use ListLinePlot with the option ScalingFunctions:

lst = MapIndexed[Thread[{#[], #2[]/2}] &, intervals /. LessEqual -> ({#, #3} &)];
Show[ListLinePlot[lst, ScalingFunctions -> {{Log[10, #] &, 10^# &}, None},
Joined -> #] & /@ {True, False}, AspectRatio -> 1/5, Axes -> {True, False}] 