# How do I put a data point in a 3D graph? I need it in (0,0,1) [closed]

This is what I have now

Clear[x, y, f]; ​​
f[x_, y_] = E^(-x^2+y);

surface = Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2}];
threedims = Axes3D[3];
datapoint = Graphics[{Red, PointSize[0.03], Point[{0,0,1}]}];

Show[threedims, datapoint,surface, ViewPoint -> CMView, PlotRange -> All, Boxed -> False]​


## closed as off-topic by MarcoB, m_goldberg, Bob Hanlon, Jens, Sjoerd C. de VriesSep 14 '15 at 5:20

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." – Bob Hanlon, Jens, Sjoerd C. de Vries
If this question can be reworded to fit the rules in the help center, please edit the question.

• mathematica.stackexchange.com/questions/41439/… – IPoiler Sep 14 '15 at 0:43
• I don't know the command Axes3D; I am also unfamiliar with the CMView option value for ViewPoint. Are you using some special plotting package? – MarcoB Sep 14 '15 at 0:53
• I figured it out, thanks! – Nika Sep 14 '15 at 1:39

Replace Graphics with Graphics3D.

Also, note that you might prefer the result using Sphere instead of Point.

datapoint = Graphics3D[{Red, Sphere[{0, 0, 1}, 0.1]}]


• I suppose you meant Point rather than Dot. – MarcoB Sep 14 '15 at 1:11
• @MarcoB right, edited. – anderstood Sep 14 '15 at 1:23

This is an extended comment on anderstood's answer, which basically correct. However, some changes in details are in order.

Better to define your function with SetDelayed ( := ).

f[x_, y_] := E^(-x^2 + y)


The plot theme "NoAxes" is the easy way to get rid of both axes and bounding box. Also, making sure surface is not clipped.

surface =
Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2},
PlotRange -> All,
PlotTheme -> {"NoAxes", "ZMesh"}];


The directive PointSize has no effect on spheres and so is not needed.

datapoint = Graphics3D[{Red, Sphere[{0, 0, 1}, .1]}];

Show[surface, datapoint, BoxRatios -> {1, 1, 1}]


The above code produces