0

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]​
MarcoB
  • 67,153
  • 18
  • 91
  • 189
Nika
  • 1

2 Answers2

3

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]}]

enter image description here

anderstood
  • 14,301
  • 2
  • 29
  • 80
3

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

plot

m_goldberg
  • 107,779
  • 16
  • 103
  • 257