1
$\begingroup$

This question already has an answer here:

Basically, I'm trying to "rotate" a plot clockwise so that the former x-axis is pointing down, and the former y-axis is pointing to the right. From reading some answers on here, I gathered that I can get axes in the right general orientations using ParametricPlot:

ParametricPlot[{Sin[7 x] - 1,x}, {x, 0, 1}, 
  PlotRange -> {{-3, 0}, {0, 1}}, 
  Frame -> True, 
  AspectRatio -> 5/8, 
  FrameLabel -> {"Label 1", "Label 2"}]

plot

But the problem is that the vertical axis still points up, and I need it to be going the other direction: I need it to be 0 at the top and 1 at the bottom.

Does anyone have any solution to this? ScalingFunctions would have worked beautifully from what I've been reading, but this seems to have been "fixed" years ago without a similar functionality put in to replace it.

Any help is appreciated!

$\endgroup$

marked as duplicate by Mr.Wizard Feb 16 '15 at 13:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ If I understand correctly, try ParametricPlot[{Sin[7x]-1, -x}, {x,0,1}] i.e. flip the new "y" by adding a minus sign. $\endgroup$ – Bill Feb 16 '15 at 4:51
  • $\begingroup$ That does seem to work, but the frame labels are now wrong, as in the labels are negative. Is there a way to fix that? $\endgroup$ – Steve Feb 16 '15 at 4:57
  • 1
    $\begingroup$ does Rotate[plot,-Pi/2] work? $\endgroup$ – Algohi Feb 16 '15 at 5:05
  • $\begingroup$ Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. $\endgroup$ – bbgodfrey Feb 16 '15 at 5:14
  • $\begingroup$ @Algohi. Your approach has an issue -- it also rotates the frame labels and the tick labels, which I think is not wanted. $\endgroup$ – m_goldberg Feb 16 '15 at 5:20
1
$\begingroup$

Perhaps this is what you are looking for.

ParametricPlot[{t, - (Sin[7 t] - 1)}, {t, 0, 1}, 
  PlotRange -> {{0, 1}, {0, 3}},
  AspectRatio -> 8/5,
  FrameTicks -> {{Table[{i, -i}, {i, 0., 3., .5}], None}, {Automatic, None}},
  Frame -> True,
  FrameLabel -> {"Label 2", "Label 1"}]

plot

$\endgroup$
1
$\begingroup$

Just for fun (but somewhat ridiculous to me):

With[{r = RotationMatrix[-Pi/2]}, 
 ParametricPlot[r.{Sin[7 x] - 1, x}, {x, 0, 1}, 
  PlotRange -> (r.{{-3, 0}, {0, 1}}), Frame -> True, 
  AspectRatio -> 5/8, FrameLabel -> {"Label 1", "Label 2"}]]

enter image description here

$\endgroup$

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