1
$\begingroup$

I am trying to get something like this:pic

It resembles the political compass. There are 4 axis, all of them always positive, and two curves are shown. One of them obeys the equation:

$d(M)=M^{0.2}$

and for the other:

$d(M)=M^{-0.2}$.

There are also two horizontal lines for $d=1$. And the origin of the graph is at $(1,0)$. The two curves are flipped like the picture. It would look nicer if the left and right sides of the graph had different background colors, like red and blue. How can I do that?

$\endgroup$
  • $\begingroup$ The bottom right curve is $M^{-0.2}$ flipped around $d=1$ and the top left curve is $M^{0.2}$ flipped around $M=0$, but I am chopping off the gap and only showing the curves for $M>1$. I can do all the flipping without setting the origin to $(1,0)$, but it looks a little weird. $\endgroup$ – Rodrigo May 25 '17 at 23:22
4
$\begingroup$

This, in fact, turns out to be possible. By combining s0rce's answer from here with Jens' plotGrid function from here, we get:

pl1 = Plot[
  m^0.2, {m, 0, 5},
  ScalingFunctions -> {"Reverse", Identity},
  AxesOrigin -> {1, 0},
  PlotRange -> {{1, 5}, {0, 2}},
  Epilog -> {Dashed, Line[{{1, 1}, {-5, 1}}]},
  Background -> LightBrown
  ]

pl2 = Plot[{}, {x, 0, 5},
  PlotRange -> {{1, 5}, {0, 2}},
  AxesOrigin -> {1, 0},
  Axes -> True,
  Epilog -> {Dashed, Line[{{1, 1}, {5, 1}}]},
  Background -> LightOrange
  ]

pl3 = Plot[{}, {x, 0, 5},
  PlotRange -> {{1, 5}, {0, 2}},
  ScalingFunctions -> {"Reverse", "Reverse"},
  AxesOrigin -> {1, 0},
  Axes -> True,
  Epilog -> {Dashed, Line[{{1, -1}, {-5, -1}}]},
  Background -> LightYellow
  ]

pl4 = Plot[
  m^(-0.2), {m, 1, 5},
  ScalingFunctions -> "Reverse",
  AxesOrigin -> {1, 0},
  PlotRange -> {{1, 5}, {0, 2}},
  Epilog -> {Dashed, Line[{{1, -1}, {5, -1}}]},
  Background -> LightBlue
  ]

plotGrid[{{pl1, pl2}, {pl3, pl4}}, 500, 300, ImagePadding -> 10]

Mathematica graphics

$\endgroup$
  • $\begingroup$ It is beautiful, thanks :D $\endgroup$ – Rodrigo May 25 '17 at 23:43
  • $\begingroup$ Ops, I think I have a problem. Mathematica won't accept the ScalingFunctions option :( $\endgroup$ – Rodrigo May 25 '17 at 23:46
  • $\begingroup$ @RodrigoGalvão What version of Mathematica? $\endgroup$ – C. E. May 25 '17 at 23:47
  • 1
    $\begingroup$ Ok, I got the correct output now :) $\endgroup$ – Rodrigo May 25 '17 at 23:57
  • 1
    $\begingroup$ @RodrigoGalvão I agree, there is something wrong in Mathematica 10. If you need to render this plot, then I would suggest using Wolfram Open Cloud. It uses the latest Mathematica version and you can get access for free. (I tried it just now to make sure that it works there.) $\endgroup$ – C. E. May 26 '17 at 0:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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