绘制也显示特定坐标的点/点的图 [英] Making plots that also show up points/dots for specific coordinates
本文介绍了绘制也显示特定坐标的点/点的图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在 Mathematica 中绘制类似的情节
I am trying to do a plot in Mathematica of something like
x^2 + y^2
x, y € [-10, 10].
with x, y € [-10, 10].
除了显示情节之外,我还希望它包含以不同颜色绘制的点(例如 (0, 0)).点 (0,0) 将显示为 (0, 0, 0).点 (1, 1) 将显示为 (1, 1, 2) 等
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.
这是我要找的:
我怎样才能做到这一点?
How 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}]
你的台词:
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}]
这篇关于绘制也显示特定坐标的点/点的图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文