Mathematica——繪制3D圖形


Plot3D

Plot3D[3 + 0.85 x + 3 y, {x, -10, 10}, {y, -10, 10}]

 

ListPointPlot3D

繪制點集

ListPointPlot3D[{{1, 3, 3}, {2, 5, 3}}, ColorFunction -> Function[{x, y, z}, Hue[0.03, 1, 1]]]

其中使用ColorFunction設置點的顏色為紅色:

 

 

使用組合的形式將兩個圖合二為一

使用show函數

Show[
  Plot3D[3 + 0.85 x + 3 y, {x, -10, 10}, {y, -10, 10}],
  ListPointPlot3D[{{
1, 3, 3}, {2, 5, 3}}, ColorFunction -> Function[{x, y, z}, Hue[0.03, 1, 1]]]
]

 

可以看到兩個圖顯示在一個坐標系內了,不過合並之后的圖沒有辦法通過面板設置樣式,只能通過代碼設置樣式,因此先單個圖形設置好樣式之后再合並。

 

Show[
  Plot3D[3 + 0.85 x + 3 y, {x, -10, 10}, {y, -10, 10},     MeshStyle -> Directive[GrayLevel[0], Dotted], Mesh -> Automatic,     MeshFunctions -> Automatic, PlotStyle -> Directive[GrayLevel[0], Opacity[0.264`]]],   ListPointPlot3D[{{1, 3, 3}, {2, 5, 3}}, ColorFunction -> Function[{x, y, z}, Hue[0.03, 1, 1]]]
]

效果:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM