How can I set the axes of a plot to be positive in both directions, along the lines of this image?
I've looked through some questions on how to change the axis direction (here, here and here) but they obviously don't fully answer my problem, and I've not got further than the options given in those questions. Presumably the answer lies in the Ticks
function, but I'm not sure how to implement it.
Edit
I am aware of custom labels and tick positions from the documentation, but am curious about a more automatic way to do it. I was thinking along the lines of the accepted answer to How to change the axes' origin and direction?, where this is given as a way of reversing the axis direction.
x = Sin /@ Range[0, 2 π, 0.1];
ListPlot[-x, Ticks -> {Automatic, Function[{xmin, xmax},
Table[{i, -i, {0.02, 0}}, {i, N@FindDivisions[{xmin, xmax}, 10]}]]}]
Is there a similar method I could use based on xmin
, xmax
and N@FindDivisions[]
, or is custom labels the way forward?
Ticks
option? $\endgroup$ – Dr. belisarius May 16 '14 at 16:52xmin
,xmax
andN@FindDivisions
? As in #3 of the accepted answer here: mathematica.stackexchange.com/questions/3747/… - I've updated my question to clarify this, sorry that it wasn't clear. $\endgroup$ – dr.blochwave May 16 '14 at 17:35