开发者

Making plots that also show up points/dots for specific coordinates

I am trying to do a plot in Mathematica of something like

x^2 + y^2

with x, y € [-10, 10].

Besides showing the plot, I'd also like it to include points (for example, (0, 0)) painted in a different color. Point (0,0) would be shown as (0, 0, 0). Point (1, 1) would be shown as (1, 1, 2), etc.

Here is what I am looking for:

Making plots that also show up points/dots for specific coordinates

How 开发者_JS百科can I achieve this?


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

Making plots that also show up points/dots for specific coordinates

Your Lines:

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

Making plots that also show up points/dots for specific coordinates

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜