Logarithmic Scaling

Ivan Cnop
icnop@vub.ac.be

Logarithmic Scaling

To visualise rapidly growing functions we need logarithmic scaling of values

Nonlinear units on axis

(2^Range)[0, 10]

Programming these as ticks

xTicks = Range[12]

yTicks = Table[{j, (2^j)}, {j, 10}]

Take logarithms of all functions and plot:

Plot[{Log[2, (2^n)], Log[2, (n^2)], Log[2, n Log[n]], Log[2, n], 
        Log[2, Log[2, n]]}, {n, 0, 14}, PlotRange -> {-2, 10}, 
      Ticks -> {xTicks, yTicks}, AspectRatio -> Automatic]

More graphs

Plot[{Log[2, (2^((n^2)))], Log[2, n!], Log[2, (n^n)], 
        Log[2, (n^((Sqrt[n])))]}, {n, 0, 14}, PlotRange -> {-1, 10}, 
      Ticks -> {xTicks, yTicks}, AspectRatio -> Automatic]

Show[%, %%]

Very slow growth can be handled by logarithmic scaling of x-axis

This is done in a similar way