# Making Axes logarithmic in 3d plots

I've been trying to get loglog plots in 3D, but to no avail. My initial approach was to take the logarithm inside the plot i.e

Plot3D[Log[10,function[a, b]],{a, 1, 100000},{b, 1, 1000000}]


but now I'm looking for a way to logarithm-ise the axes as well. Any help would be greatly appreciated!

-
Something that you could do would be to get the logarithm outside the plot, and then use the LogTicks (from the LevelScheme package) to rescale the axes. This worked for me – Sosi Mar 13 at 14:53
@Sosi why don't you post that (with details) as an answer? – rcollyer Mar 13 at 15:06
@Sosi, thanks, but I'm very new to mathematica and unfamiliar with the LogTicks command. Could you give me any tips on using it? – Gokotai Mar 13 at 17:15

You first have to install the LevelScheme package, it's worth it if you produce a lot of figures.

<< LevelScheme


Assign a function and do the 3D plot:

function = Log[10, a x + b /. a -> 1];
Plot3D[function, {x, 1, 3}, {b, -1, 3},
PlotRange -> {{1, 3}, {-1, 3}, {-1, 1}},
Ticks -> {LogTicks[10, 1, 3], LogTicks[10, -1, 3], LogTicks[10, -1, 1]}
]


This would produce this figure:

LevelScheme (and more specifically the Custom Ticks package) is really nice to do these things!

-
This helped alot, thanks a bunch! – Gokotai Mar 13 at 20:00
Maybe still more for future versions of Mathematica but the option ScalingFunctions -> {"Log", "Reverse"} has been introduced for Gauges, Histograms and BarCharts in version 9. Unluckily, it fails in number of instances. I reported this as an error a while ago. Since the implementation is very general, I cannot see why it should not also become available for all other Plot-related functions. – Ernst Stelzer Mar 14 at 7:33

LogTicks is really nice. However, if you might wish to avoid another package or have more control over the final output, here is a template. As mentioned in a comment above, I actually hope that ScalingFunctions will be fully implemented in the future.

function[a_, b_] := Log[10, a + b]

Plot3D[Log[10, function[#^10 &@a, #^10 &@b]], {a, Log10@1,
Log10@100000}, {b, Log10@1, Log10@100000},
Ticks -> {Table[{y, ToString[Round[10^y, 0.001]]}, {y, Log[10, 1],
Log[10, 100000]}],
Table[{y,
ToString[
Round[10^y, 0.001] // ScientificForm // TraditionalForm]}, {y,
Log[10, 0.001], Log[10, 100000]}], Automatic}]
`

-