2
$\begingroup$

In the following plot,

  1. why is there some non connected dots,
  2. why the colors are'nt true.

elec = {66.`, 600.`, 200.`, 126.`, 68.`, 52.`, 114.`, 229.`, 71.`, 
   141.`, 39.`, 119.`, 224.`, 121.`, 457.`, 53.`, 167.`, 82.`, 304.`, 
   138.`, 235.`, 154.`, 181.`, 129.`, 1411.`, 134.`, 164.`, 126.`, 
   369.`, 130.`, 179.`, 100.`, 192.`, 472.`, 80.`};
sieg = {2.`, 7.`, 3.`, 2.`, 2.`, 2.`, 2.`, 3.`, 2.`, 2.`, 1.`, 2.`, 
   3.`, 2.`, 5.`, 2.`, 3.`, 2.`, 4.`, 2.`, 3.`, 2.`, 3.`, 2.`, 16.`, 
   2.`, 2.`, 2.`, 3.`, 2.`, 3.`, 2.`, 3.`, 5.`, 2.`};
r = sieg/elec
m = Mean[r]
mm = Table[m, {i, 36}];
s = StandardDeviation[r]
g1 = ListPlot[{sieg/elec, mm}, Filling -> {1 -> {2}}];
g2 = Plot[ {m, m + s, m - s, m + 2 s, m - 2 s}, {x, 0, 36}, 
   Filling -> {1 -> {5}, 1 -> {4}, 1 -> {2}, 1 -> {3}}, 
   FillingStyle -> {{Opacity[.001], LightYellow}, 
     LightBlue, {Opacity[.001], Red}}];
Show[g2, g1]

enter image description here

$\endgroup$
2
  • $\begingroup$ Add PlotRange -> All to g1. Try with 1 -> {5, Directive[Opacity[.001], LightYellow]} for Filling, also opacity 0.001 means this is almost transparent. $\endgroup$
    – Kuba
    Commented Jul 4, 2017 at 7:48
  • $\begingroup$ The first info works but for g2 = Plot[ {m, m + s, m - s, m + 2 s, m - 2 s}, {x, 0, 35}, Filling -> {1 -> {2, Directive[Opacity[.3], LightYellow]}, 1 -> {3, Directive[Opacity[.3], LightRed]}}, PlotRange -> {0, .04}]; the fill is not in the good direction $\endgroup$ Commented Jul 4, 2017 at 8:44

1 Answer 1

4
$\begingroup$
Plot[{m, m + s, m - s, m + 2 s, m - 2 s}, {x, 0, 35}, 
 Filling -> {1 -> {{2}, Opacity[.3, Yellow]},  1 -> {{3}, Opacity[.3, Yellow]}, 
     2 -> {{4}, Opacity[.3, Red]}, 3 -> {{5}, Opacity[.3, Red]}}, 
 PlotRange -> {0, .04},
 Epilog -> ListPlot[{sieg/elec, mm}, Filling -> {1 -> {2}}, PlotRange -> All][[1]]]

Mathematica graphics

$\endgroup$
1
  • 1
    $\begingroup$ I would never have thought that one can use ListPlot in an Epilog. Thanks. $\endgroup$ Commented Jul 4, 2017 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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