
如何在Mathematica的3D繪圖中自訂格線?
Plot3D[Sin[x + y], {x, -2 Pi, 2 Pi}, {y, -2 Pi, 2 Pi}]

Show[Plot3D[
Sin[x+y],{x,-2Pi,2Pi},{y,-2Pi,2Pi},
(*使用MeshFunction畫出以圓點為圓心的格線*)
MeshFunctions->Function[{x,y},x^2+y^2],
MeshStyle->{Red,Thickness[0.005]}],
(*新增一條特定格線*)
Graphics3D[{Green,Thickness[0.01],
Map[Line,Partition[{#[[1]],#[[2]],Sin[#[[1]]+#[[2]]]}&/@
ContourPlot[x^2+y^2==Pi,{x,-2Pi,2Pi},{y,-2Pi,2Pi}][[1,1]],2,1]]}]
]

SphericalPlot3D[1, {\[Phi], 0, Pi}, {\[Theta], 0, 2 Pi}]

f[\[Theta]_, \[Phi]_] = Sin[\[Theta] + \[Phi]];
SphericalPlot3D[1, {\[Phi], 0, Pi}, {\[Theta], 0, 2 Pi}, ColorFunctionScaling->False,
(*相對於其他的繪圖函數,MeshFunction也是適用!*)
MeshFunctions->{Function[{x, y, z, \[Theta], \[Phi], r}, f[\[Phi], \[Theta]]]},
MeshStyle->{Red, Thickness[0.005]}]

讀者回應 ( 0 意見 )
訂閱發佈留言 (Atom)
發佈留言
Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.
如果這篇文章對你有幫助,那請留個訊息給我~