Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to make a chart where the x-axis has a log scale and the y-axis is in reverse order. I tried to use LogLinearPlot, and I tried to combine it with ScalingFunctions. My code was:

LogLinearPlot[1/x, {x, 1, 1000}, ScalingFunctions->"Reverse"]

But this failed. So I tried using Plot and ScalingFunctions:

Plot[1/x, {x, 1, 1000}, ScalingFunctions -> {"Log", "Reverse"}]

That gave me an error as well. I noticed that ScalingFunctions works just fine when applied to the y-axis, as in:

Plot[1/x, {x, 1, 1000}, ScalingFunctions -> "Log"]
Plot[1/x, {x, 1, 1000}, ScalingFunctions->"Reverse"]

However, when I apply ScalingFunctions to the x-axis, it will give an error; for example:

Plot[1/x, {x, 1, 1000}, ScalingFunctions -> {"Log", Identity}]

Can anyone tell me what to do to get a reversed y-axis and a logarithmic x-axis at the same time?

share|improve this question
I mentioned a problem with ScalingFunctions in "…; and reported a bug to Wolfram. This might be a more serious issue. – Ernst Stelzer Feb 9 '13 at 11:49

At least in v8, the following:

Reap@Plot[1/x, {x, 1, 1000}, ScalingFunctions -> (Sow@## &)]

reveals that the only argument passed to ScalingFunctions is the y coordinate. So, it wont scale the x axis.

But instead you may post-process the ticks generated by default:

k[f_] := Show[#, AbsoluteOptions[#, Ticks] /. {x_, x_, y__} :> {x, -x, y}] &@
                                                                LogLinearPlot[-f[x], {x, 1, 1000}]
f[x_] := 1/x;

Mathematica graphics

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.