Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I would like to plot the following function

Plot[(1/x (0.01/(0.01 + x^2) - (10/(10 + x^2))^2)), {x, 0, 10}, 
 Frame -> True, PlotRange -> All]

which is very peaked at 0.01 in log scale, to show it up to higher values, i.e.:

LogPlot[-(1/x (0.01/(0.01 + x^2) - (10/(10 + x^2))^2)), {x, 0, 100}, 
 Frame -> True, PlotRange -> {10^-9, 10}]

However, since function is negative, I must add a minus sign to the function. I would like to get something like the log plot above, but with the y-axis going downwards and with negative values, looking similar to the plot below

LogPlot[-(1/x (0.01/(0.01 + x^2) - (10/(10 + x^2))^2))^-1, {x, 0, 10},
  Frame -> True, PlotRange -> {0.1, 10^3}]

but with the right scaling for log axis and negative value sin stead of positive ones, is it possible?

Thanks in advance

share|improve this question
2  
Do you require something like the following? f[x_] := (1/x (0.01/(0.01 + x^2) - (10/(10 + x^2))^2)); myTicks = N[Table[{10^i, -10^i}, {i, -9, 1}]]; LogPlot[-f[x], {x, 0, 100}, Frame -> True, PlotRange -> {10^-9, 10}, FrameTicks -> {Automatic, myTicks, None, None}] –  Boson Mar 21 at 17:06
    
Not, exactly, but I see the solution, because this does the work myTicks = N[Table[{10^-i, -10^i}, {i, -9, 1}]]; LogPlot[- f[x], {x, 0, 100}, Frame -> True, PlotRange -> {10^-9, 10}] LogPlot[-f[x]^-1, {x, 0, 100}, Frame -> True, PlotRange -> {1/10, 10^9}, FrameTicks -> {Automatic, myTicks, None, None}] –  pablo Mar 21 at 17:34
add comment

1 Answer 1

up vote 2 down vote accepted

It seems something like this does the work. Taking the inverse, just produce the negative value for the log. Then, relabeling the ticks (but using also the inverse, solves the work)

myTicks = 
 N[Table[{10^-i, -10^i}, {i, -9, 1}]]; LogPlot[-f[x], {x, 0, 100}, 
 Frame -> True, PlotRange -> {10^-9, 10}]
LogPlot[-f[x]^-1, {x, 0, 100}, Frame -> True, 
 PlotRange -> {1/10, 10^9}, 
 FrameTicks -> {Automatic, myTicks, None, None}]

Thanks to Boson which helped here.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

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.