制作也显示特定坐标的点/点的图

时间:2010-11-19 02:33:31

标签: wolfram-mathematica

我正试图在Mathematica中做一个类似

的情节
x^2 + y^2

x,y€[-10,10]。

除了显示情节之外,我还希望它包含以不同颜色绘制的点(例如,(0,0))。点(0,0)将显示为(0,0,0)。点(1,1)将显示为(1,1,2)等。

以下是我要找的内容:

alt text

我怎样才能做到这一点?

1 个答案:

答案 0 :(得分:1)

f[x_, y_] := x^2 + y^2;
t = Flatten[Table[{x, y, f[x, y]}, {x, 0, 10, 1}, {y, 1, 2, 1}], 1];
a = ListPointPlot3D[t, PlotStyle -> PointSize[0.05]];
b = Plot3D[f[x, y], {x, -10, 10}, {y, -10, 10}, 
   ColorFunction -> "MintColors"];
Show[{b, a}]

alt text

你的台词:

f[x_, y_] := x^2 + y^2;
t = Flatten[Table[{x, y, f[x, y]}, {x, 0, 10, 1}, {y, 5, 5, 1}], 1];
l = Table[ Graphics3D[{Thickness[.01], Green, 
           Line[{i, {i[[1]], i[[2]], 200} }]}], {i, t}];

a = ListPointPlot3D[t, PlotStyle -> PointSize[0.05]];
b = Plot3D[f[x, y], {x, -10, 10}, {y, -10, 10}, 
   ColorFunction -> "MintColors"];

Show[{b, a, l}]

alt text