1
$\begingroup$

I am plotting three equation

Plot[{x/100, x/80, (5 (400 + x))/10000}, {x, 0, 1}]

for $0\leq x\leq 1$

The problem is that the plot shows these equation as if they are just three horizontal lines without clearly showing that they are increasing as $x$ increases.

Is there a way to do some sort of scaling to the plot to show that they are changing?

Thank you.

$\endgroup$
4
  • $\begingroup$ LogPlot helps a bit with x/100 and x/80. $\endgroup$
    – JimB
    Dec 9, 2016 at 5:00
  • $\begingroup$ Put them on separate plots, which are vertically stacked in such a way that the horizontal axes are aligned. $\endgroup$
    – Szabolcs
    Dec 9, 2016 at 9:22
  • $\begingroup$ @Szabolcs, but I want them to be in the same plot. $\endgroup$
    – MrDi
    Dec 9, 2016 at 10:12
  • 2
    $\begingroup$ Think about why you need to show them in the same plot. Do you really need to? If yes, is that because the values need to be comparable? If so, that sets a scale of $10^{-1}$, compared to which your third function is to all practical purposes constant. You need to go to a scale of $10^{-4}$ to see any changes. Is that scale relevant to your application? If yes, then show it: the only way is with two plots. If not, then I don't see why you need to show that it's not constant. $\endgroup$
    – Szabolcs
    Dec 9, 2016 at 11:26

3 Answers 3

1
$\begingroup$

With Jens's plotGrid:

plot1 = Plot[(5 (400 + x))/10000, {x, 0, 1}, 
  PlotRange -> {Full, {0.1995, 0.201}}, 
  Ticks -> {None, {0.19, 0.20, 0.21}}, PlotStyle -> Darker@Green, 
  Frame -> {False, True, True, True}]
plot2 = Plot[{x/100, x/80}, {x, 0, 1}, 
  PlotRange -> {Full, {0, 0.015}}, Ticks -> {Automatic, {0.01, 0.02}},
   PlotStyle -> {Blue, Red}, Frame -> {True, True, False, True}]

plotGrid[{{plot1}, {plot2}}, 500, 500, ImagePadding -> 40]

enter image description here

$\endgroup$
3
  • $\begingroup$ Can the line in the middle between the two figures be removed? $\endgroup$
    – MrDi
    Dec 9, 2016 at 13:25
  • $\begingroup$ See the edited answer. Although in such a situation I'd recommend employing R. M.'s method. $\endgroup$
    – corey979
    Dec 9, 2016 at 13:35
  • $\begingroup$ @MrDi With the dividing line removed, the plot, while aesthetically pleasing, becomes quite confusing to understand. As Szabolcs suggested, think about what information you're trying to convey. If the slopes are the important part, you could plot each curve relative to its value at x=0 -- that would put everything on the same plot without messing with the axes: Plot[{x/100, x/80, (5 (400 + x))/10000 - (5 (400))/10000}, {x, 0, 1}]. $\endgroup$ Dec 9, 2016 at 22:56
3
$\begingroup$

Here's a method based on this answer:

snip[pos_] := Arrowheads[
  {{Automatic, pos, Graphics[{BezierCurve[2 {{0, -(1/2)}, {1/2, 0}, {-(1/2), 0}, {0, 1/2}}]}]}}
];

p1 = Plot[{x/100, x/80}, {x, 0, 1}, AxesStyle -> {None, snip[1]}, 
  ImagePadding -> {{35, 10}, {20, 3}}, PlotRange -> {0, .012}
];

p2 = Plot[(5 (400 + x))/10000, {x, 0, 1}, PlotStyle -> RGBColor[0.560181, 0.691569, 0.194885], 
  Axes -> {False, True}, AxesStyle -> {None, snip[0]}, PlotRange -> {.1995, .2006}, 
  ImagePadding -> {{35, 10}, {3, 20}}
];

Column[{p2, p1}, Spacings -> 0]

Mathematica graphics

$\endgroup$
0
2
$\begingroup$

Maybe you could stack two plots something like this.

enter image description here

It's a little tricky to get the scales and tick marks to work out.
Maybe you can tinker with this code to get an effect that works.

Framed@ColumnForm[{
   Plot[(5 (400 + x))/10000, {x, 0, 1},
    PlotRange -> {Full, {0.18, .22}},
    Ticks -> {None, {0.19, 0.20, 0.21}},
    PlotStyle -> Darker@Green],
   Plot[{x/100, x/80}, {x, 0, 1},
    PlotRange -> {Full, {0, 0.02}},
    Ticks -> {Automatic, {0.01, 0.02}},
    PlotStyle -> {Blue, Red}]
   }]
$\endgroup$
1
  • $\begingroup$ See also here and here. $\endgroup$
    – corey979
    Dec 9, 2016 at 13:10

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