# Transforming a 3D into a 2D Plot

I have a ListPointPlot3D in which all points lie on a plane. I'd like to transform it into a simple 2D Plot by looking at the points from an orthogonal direction to that plane, but I don't know how to do it. (The following is a MWE, not my actual data).

 points = Flatten[Permutations /@ IntegerPartitions[1, {3}, Range[0, 1, 1/5]], 1];
ListPointPlot3D[points]

• Do you know the normal? Commented Dec 4, 2020 at 10:38
• @UlrichNeumann. The plane is $x+y+z=1$, I think $(1,-1,-1)$ is normal to that (I'm a bit out of my depth in this) Commented Dec 4, 2020 at 10:53
• We could agree on n~{1,1,1}? Commented Dec 4, 2020 at 11:18
• Yes, my mistake Commented Dec 4, 2020 at 11:22

If you want to look at the points from a viewpoint perpendicular to the plane without distortion, you must first determine a vector that is perpendicular. You can do this using the cross product of the three first points:

perp=Cross[points[[2]]-points[[1]],points[[3]]-points[[1]]];


perp is now perpendicular. To eliminate the perspective distortion we multiply it with a large number . Finally we can set the viewpoint:

ListPointPlot3D[points, ViewPoint -> 100 perp, AxesLabel -> {"x", "y", "z"}]


• Is it possible to eliminate the box altogether? I've tried Axes->None to no avail. Commented Dec 4, 2020 at 11:15
• Use: Axes -> None, Boxed -> False Commented Dec 4, 2020 at 11:19
• I thought that from an orthogonal perspective, the triangle would look equilateral Commented Dec 4, 2020 at 11:35
• Of course you are right. All 3 axis should be represented with equal length. To achieve this, we need: BoxRatios -> {1, 1, 1} Commented Dec 4, 2020 at 16:12

If we know the normal direction n~ {1,1,1} we can define an orthonormal coordinate system {e1,e2,n}

n = #/Sqrt[#.#] &[{1, 1, 1}];
e2 = #/Sqrt[#.#] &[Cross[n, {1, -1, 0}] ]
e1 = #/Sqrt[#.#] &[Cross[n, e1]]


e1,e2 both lie in the plane.

Projection of the points normal to n

pe=Map[# - n (n.#) &, points];(* pe normal to n *)


Plot the points in the e1,e2 system

ListPlot[Map[{#.e1, #.e2} &, pe], AxesLabel -> {"e1", "e2"}]


• Does your procedure do explicitly what @DanielHuber's does implicitly? Commented Dec 9, 2020 at 11:31
• @Patricio My "procedure" performs the projection into a plane (defined by n) and returns finally the coordinates in the e1,e2 system (2D) . The choice of the plane coordinate system e1,e2 isn't unique. Commented Dec 9, 2020 at 11:44
• Thank you very much! Commented Dec 9, 2020 at 11:51

3D method

points = Flatten[
Permutations /@ IntegerPartitions[1, {3}, Range[0, 1, 1/5]], 1];
ListPointPlot3D[points, Boxed -> False, Axes -> False,
ViewProjection -> "Orthographic", ViewPoint -> {1, 1, 1},
AspectRatio -> 1]


2D method

We can rotate the normal vector {1,1,1} to {0,0,1} and make the plane parallel to the x-y plane ,after that we can project the points to the x-y plane just by erase the third coordinate.

points = Flatten[
Permutations /@ IntegerPartitions[1, {3}, Range[0, 1, 1/5]], 1];
rotation = RotationMatrix[{{1, 1, 1}, {0, 0, 1}}];
pts = Table[rotation.point, {point, points}];
newpoints = Drop[#, -1] & /@ pts;
ListPlot[newpoints, PlotStyle -> {PointSize[Large], Red},
AspectRatio -> 1]


• Your 2D method is a projection ~ {0,0,1}! That's not the direction of the normal I think. Commented Dec 4, 2020 at 11:20