Search code examples
plotwolfram-mathematica

How can I label axes using RegionPlot3D in Mathematica?


I would like to have a means to plot a solid in R^3 using RegionPlot3D and view it from a specified point on one of the axes so that the remaining axes appear in a specified manner. For example, suppose I wish to view the plane x+y+z=1 from the point (0,0,5) in such a way that the positive x-axis points to the right and the positive y-axis points up. The problem I have is with the labelling of axes.

What I've tried:

RegionPlot3D[0 <= z && z <= 1 - x - y && 0 <= y <= 1 - x , {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, 
Mesh -> All, PlotPoints -> 100, AxesLabel -> Automatic, LabelStyle -> Directive[Black, 12], 
ViewPoint -> {0, 0, 5}, ViewAngle -> 0 Degree, PlotStyle -> Green]

The resulting green "triangle" looks like it should when viewed from the positive z-axis, but none of the axes are labeled.


Solution

  • RegionPlot3D[0 <= z && z <= 1 - x - y && 0 <= y <= 1 - x,
     {x, 0, 1}, {y, 0, 1}, {z, 0, 1},
     ViewPoint -> {0, 0, 5}, PlotStyle -> Green,
     AxesEdge -> {{-1, 1}, {-1, 1}, None},
     AxesLabel -> Automatic]