5
$\begingroup$

I was trying to answer this question (here) and I found that I can't use Epilog with Show. consider this Example:

p1 = Plot[Sin[x], {x, 0, 4}, 
  Epilog -> {PointSize[0.04], Point[{1, 0.5}]}]

enter image description here

p2 = Plot[Cos[x], {x, 0, 4}, 
  Epilog -> {Red, PointSize[0.04], Point[{2, 0.5}]}]

enter image description here

Show[p1, p2]

enter image description here

It is clear that only Epilog of the first plot is taken.

Any idea why?

Thanks

$\endgroup$
1
  • $\begingroup$ I guess you already know how to combine the Epilogs manually so I didn't include that. $\endgroup$
    – Szabolcs
    Jan 22, 2015 at 21:06

1 Answer 1

4
$\begingroup$

This is consistent with how Show handles options in general.

Show will combine the graphics from the first (p1) and the second (p2) Graphics expression. But all the options of the result will simply be inherited from the first one (p1). The options of the second one (p2) are ignored.

Epilog is handled the same way as all the other options: it is inherited from p1 and p2's setting is ignored.

$\endgroup$
1
  • $\begingroup$ Exactly. Compare Show[p1,p2] to Show[p2,p1]. $\endgroup$ Jan 22, 2015 at 21:18

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