Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plot, plane, point, line, sphere in same 3D plot. Multiple figures in same plot in Mathematica

How do I plot for example a plane and a line in same 3D plot?

like image 924
Joelmob Avatar asked Sep 15 '11 18:09

Joelmob


2 Answers

Show and Plot3D can handle it. There are probably many other ways.

l = Line[{{-2, -2, 41}, {6, 4, -10}}];

Show[{Plot3D[{2 x + 7 y}, {x, -2, 5}, {y, -2, 5},  AxesLabel -> {x, y, z}], 
      Graphics3D[{Thick, l}]}]

Plot3D

like image 115
DavidC Avatar answered Oct 11 '22 23:10

DavidC


I couldn't resist either...

enter image description here

GraphicsGrid[
 {
  {ContourPlot3D[x + 2 y + 3 z , {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
    Contours -> {0}, Axes -> None, ColorFunction -> (White &), 
    Lighting -> "Neutral"], 
   Style["One plane", FontFamily -> "Comic Sans MS", 36, Bold]},
  {ContourPlot3D[x + 2 y + 3 z , {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
    Contours -> {0, 5}, Axes -> None, ColorFunction -> (Green &), 
    Lighting -> "Neutral"], 
   Style["Two plane", FontFamily -> "Comic Sans MS", 36, Bold]},
  {ContourPlot3D[x + 2 y + 3 z , {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
    Contours -> {0}, Axes -> None, ColorFunction -> (Red &), 
    Lighting -> "Neutral"], 
   Style["Red plane", FontFamily -> "Comic Sans MS", 36, Bold]},
  {Show[
    ContourPlot3D[x + 2 y + 3 z , {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
     Contours -> {0}, Axes -> None, ColorFunction -> (Blue &), 
     Lighting -> "Neutral"],
    Graphics3D[{Orange, Thickness[0.01], 
      Line[{{-2, -2, -2}, {2, 2, 2}}]}]
    ], Style["Blue plane", FontFamily -> "Comic Sans MS", 36, Bold]}
  }
 ]
like image 38
Sjoerd C. de Vries Avatar answered Oct 11 '22 22:10

Sjoerd C. de Vries