Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to visualize 3D points with Plot3D using the option Epilog. If you check the options of Plot3D ( Options[Plot3D] ), it can be seen that Epilog is one of the options of Plot3D. But when implementing this option not result as expected. for example:

  data = Flatten[
  Table[{i, j, i^2 + j^2}, {i, -2, 2, .5}, {j, -2, 2, .5}], 1];
    Plot3D[Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}, 
     Epilog -> {PointSize[Large], Point[data]}, PlotRange -> All]

Of course there is another ways (like using Show), but the question is why Plot3D does not accept its own option?

share|improve this question
"In three-dimensional graphics, two-dimensional graphics primitives can be specified by the Epilog option. The graphics primitives are rendered in a 0,1 coordinate system": Plot3D[Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}, Epilog -> {PointSize[Large], Point[{.5, .5}]}, PlotRange -> All] – Kuba Jul 8 '14 at 8:13
@kuba Still the points are in the {x,y} plan. I am looking to have the points in 3D. you can see the difference between Show[ListPointPlot3D[ Table[{i, j, i^2 + j^2}, {i, -2, 2, .1}, {j, -2, 2, .1}], PlotStyle -> Directive[PointSize[0.02], Red]], Plot3D[Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}]] and Plot3D[Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}, Epilog -> {PointSize[Large], Point[Table[{i, j}, {i, -2, 2, .1}, {j, -2, 2, .1}]]}, PlotRange -> All] – Algohi Jul 8 '14 at 8:32
@Algohi If you want a point, just use Show and Graphics3D[Point@something]. – Öskå Jul 8 '14 at 8:37
closely related: 41439 – Kuba Jul 8 '14 at 8:38
See here for example- as Öskå said, use show... – ciao Jul 8 '14 at 8:39
up vote 13 down vote accepted

Why does Plot3D not accept its own option?

But it does accept it just fine, as Kuba's comment shows:

Plot3D[Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2},
 Epilog -> {PointSize[Large], Point[{.5, .5}]}, PlotRange -> All]

I guess you mean to ask,

Why does Plot3D not accept 3D graphics in Epilog?

Because Epilog is for drawing things in front of the plot, just as Prolog is for drawing things behind the plot. So, the ordering is: a flat 2D layer for Prolog, then the 3D plot, then a flat 2D layer for Epilog. (Like a sandwich... mmm.) If Epilog accepted 3D graphics, then they would exist in the same space as the plot itself, and would not always appear in front.

(Actually, Mathematica could in principle allow 3D graphics in Epilog by rendering them with the same viewpoint but on a separate buffer and then compositing the result on top of the plot, so that you would always see them even when they are geometrically behind the plot. But I imagine that would be rarely useful and often confusing.)

share|improve this answer
Thanks for clarifying the question and for explaining how Epilog works :) – Algohi Jul 8 '14 at 9:09
You just had to use the sandwich analogy… mmm, sandwich. (+1, of course.) – J. M. Jun 1 '15 at 22:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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