Message Boards Message Boards

0
|
302 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to plot (2D) the projection of two planes in a 3D graph?

Posted 14 days ago

I have a 3D data set that I have represented in a graph. Subsequently, I have defined two planes that intersect the obtained figure at x and y, intersecting the data with a minimum value of z. I would like to obtain the graphs of the 2D curves that are projected in the initial figure under the intersection of the planes where in one the minimum of the new curve is the value of x for minimum z and in the other the value of y.

It has been proposed to me to do an interpolation, but it is not possible, since there are multiple data with the same value of x and different y.

The code is:

datos = {{2.3, 4.0, 1.212}, {2.3, 4.1, 1.005}, {2.3, 4.2, 0.88}{2.3,4.3, 0.828}, {2.3, 4.4, 0.8404}, {2.3, 4.5, 0.9091}, {2.3, 4.6, 1.027}, {2.1, 3.8, 1.279}, {2.1, 3.9, 1.0384}, {2.1, 4.0, 0.8887}, {2.1, 4.1, 0.82}, {2.1, 4.15, 0.813}, {2.1, 4.2, 0.8227}, {2.1, 4.3, 0.88844}, {2.1, 4.35, 0.9424}, {2.1, 4.4, 1.009}, {2.1, 4.45, 1.0881}, {2.1, 4.5, 1.178}, {2.2, 4.15, 0.8427}, {2.2, 4.2, 0.8217}, {2.3, 4.2, 0.8799669337077713`}, {2.4, 4.2, 0.9963}, {1.9, 4.2, 1.0199758812690207}, {1.8, 4.2, 1.5233}, {2.0, 4.2, 0.8856076060224287`}, {2.2, 3.8, 1.5646}, {2.2,4.3, 0.82964}, {2.2, 4.35, 0.8564}, {2.2, 4.4, 0.8971}, {2.2, 4.5, 1.016518265050807}, {2.2, 4.6, 1.181428279516127}, {2.0, 4.6, 1.6557430652615237}, {2.0, 4.5, 1.3990826842632}, {2.0, 4.4, 1.1812664252171354}, {2.0, 4.35, 1.0886626776777466}, {2.0, 4.3, 1.007962917838608}, {2.0, 4.2, 0.8856076060224287}, {2.0, 4.15, 0.845922223275994}, {2.0, 4.1, 0.8216559782498348}, {2.0, 4.0, 0.8237258088572351}, {2.0, 3.9, 0.900707731524648}, {2.0, 3.8, 1.0622674412720716}, {1.9, 4.35, 1.3075228435074677}, {1.9, 4.0, 0.8296262380492792}, {1.9, 4.25, 1.1036043673793587}, {2.0, 4.25, 0.9400136847425637}, {2.1, 4.25, 0.8482517670565681}, {2.2, 4.25, 0.8177531605442097}, {2.3, 4.25, 0.8454401150830607}, {1.8, 3.7, 0.9717940708671742}, {1.8, 3.9, 0.9879974492241449}, {1.8, 4, 1.1061402299909153}, {1.8, 4.1, 1.287126422049739}, {2.15, 4.3, 0.8517350572025426}, {2.15, 4.35, 0.8921846379723392}, {2.15, 4.4, 0.9460092405857214}, {2.15, 4.25, 0.8255974118165675}, {2.15, 4.2, 0.8147302884679374}, {2.15, 4.15, 0.8202313032580684}, {2.15, 4.1, 0.8431140507584328}, {1.95, 4., 0.8167974459299269}, {1.95, 3.95, 0.8277902096574934}, {2.05, 4.0, 0.8478984024702497}, {2.05, 4.05, 0.8211048969554303}, {2.05, 4.1, 0.8126006353994589}, {2.05, 4.15, 0.8212675830473939}};

puntoMinimo = First[MinimalBy[datos, Last]]; 

plano = InfinitePlane[puntoMinimo, {{0, 1, 0}, {0, 0, 1}}];

minx = pchi = Show[
  ListPlot3D[datos, InterpolationOrder -> 7, Mesh -> Full],
  Graphics3D[{Opacity[0.5], plano}]]

plano = InfinitePlane[puntoMinimo, {{1, 0, 0}, {0, 0, 1}}];

miny = pchi = Show[
  ListPlot3D[datos, InterpolationOrder -> 7, Mesh -> Full],
  Graphics3D[{Opacity[0.5], plano}]]

Show[miny, minx]
POSTED BY: Marina Nebot
3 Replies

You enclose the lines into Graphics:

lineXZ = lines3D[[1]] /. {x_, y_, z_} :> {x, z};
lineYZ = lines3D[[2]] /. {x_, y_, z_} :> {y, z};
Graphics[lineXZ, Frame -> True]
Graphics[lineYZ, Frame -> True]
POSTED BY: Gianluca Gorni
Posted 13 days ago

Thanks, and how can I draw those graphs in a separate plot, outside the figure?

POSTED BY: Marina Nebot

I think you forgot a comma after the third point of datos. You can generate the two intersection lines using Mesh, and then extract the primitives:

lp = ListPlot3D[datos, InterpolationOrder -> 7, 
  MeshFunctions -> {#1 &, #2 &}, 
  Mesh -> {{puntoMinimo[[1]]}, {puntoMinimo[[2]]}}, 
  BoundaryStyle -> None]
lines3D = Cases[lp[[1]] // Normal, _Line, All]
Show[lp,
 Graphics3D[{Thick, lines3D, Opacity[.5], 
   InfinitePlane[puntoMinimo, {{0, 1, 0}, {0, 0, 1}}], 
   InfinitePlane[puntoMinimo, {{1, 0, 0}, {0, 0, 1}}]}]]
lines3D[[1]] /. {x_, y_, z_} :> {x, z}
lines3D[[2]] /. {x_, y_, z_} :> {y, z}
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract