7
$\begingroup$

I want to flip a figure vertically but label the y-axis inversely. Please see this example:

Plot[2 Sin[x] + x, {x, 0, 15}, Frame -> True, Axes -> False]

enter image description here

What I want is the following figure. How can I do it? Thank you in advance.

enter image description here

$\endgroup$
0

2 Answers 2

13
$\begingroup$

You can use the option ScalingFunctions to achieve what you want:

Plot[
    2 Sin[x]+x,
    {x,0,15},
    Frame->True,
    ScalingFunctions->{Identity,"Reverse"}
]

enter image description here

$\endgroup$
0
$\begingroup$

Here is an alternative way to do it.

Plot[-(2 Sin[x] + x), {x, 0, 15}, Frame -> True, Axes -> False, 
 FrameTicks -> {{Transpose@{Range[0, -15, -5], Range[0, 15, 5]}, 
    None}, {Automatic, None}}]

enter image description here

$\endgroup$

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