# Why Plot3D does not accept Epilog option [closed]

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?

-

## closed as off-topic by Kuba, Öskå, rasher, ubpdqn, Sjoerd C. de VriesJul 8 at 10:44

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Kuba, Öskå, rasher, ubpdqn, Sjoerd C. de Vries
If this question can be reworded to fit the rules in the help center, please edit the 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 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 at 8:32
@Algohi If you want a point, just use Show and Graphics3D[Point@something]. –  Öskå Jul 8 at 8:37
closely related: 41439 –  Kuba Jul 8 at 8:38
See here for example- as Öskå said, use show... –  rasher Jul 8 at 8:39

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.)

-
Thanks for clarifying the question and for explaining how Epilog works :) –  Algohi Jul 8 at 9:09