func={x+y+z<1&&x+y<z,x+y+z<1&&x+z<y,x+y+z<1&&y+z<x,x+y+1<z,x+z+1<y,y+z+1<x};
framelabels = TraditionalForm /@ {Abs[Subscript[u, 1]],
Abs[Subscript[u, 2]],Abs[Subscript[u, 3]]};
RegionPlot3D[func,{x,0,2},{y,0,2},{z,0,2},AxesOrigin->{0,0,0},Axes->True,AxesStyle -> Thick,AxesLabel->framelabels,ImageSize->Large,LabelStyle -> {14, Bold, Black},Mesh->None,PlotStyle->{Red,Blue,Purple,Brown,Green,Yellow},PlotPoints->100]
I used the above code to generate a 3D plot. But I want to add label to different regions in this plot by using PlotLabels
but it is not working in a 3D plot. Although I used it for 2D RegionPlot
and it worked well as shown in the diagram below .
The exact code for the 2D plot above is:
funcs = {x < 1 && y < 1 && x + 2 (x y)^(1/2) < 1,
y < 1 && x > 1 && 1/x + 2 (y/x)^(1/2) < 1,
((1/(x y))^(1/2) + (x/( y))^(1/2))^(2) < 4 ,
x y < 1/4 && y > 1 && x + 2 (x y)^(1/2) < 1,
y/ x < 1/4 && y > 1 && 1/x + 2 (y/x)^(1/2) < 1};
labels = TraditionalForm[Subscript[\[ScriptCapitalR], #]]&/@ Range[Length[funcs]];
framelabels = TraditionalForm /@ {Abs[Row[{Subscript[u, 1], "/", Subscript[u, 3]}]],
Abs[Subscript[u, 2]]};
RegionPlot[funcs, {x, 0, 9}, {y, 0, 3},
PlotLabels -> Join[Placed[#,Center] & /@ labels[[;;3]],
{Placed[labels[[4]], {{.1,1.4}, {10,.9}}], Placed[labels[[5]], Center]}],
LabelStyle -> {15, Bold, Black}, PlotPoints -> 100,
Axes -> True, Frame -> True, FrameLabel -> framelabels,
RotateLabel -> False, FrameStyle -> Directive[Black, 12],
PlotStyle -> {Red, Green, Cyan, Yellow, Purple}]
As you can see the above code I used PlotLabels
inside PlotRegion
but when I put it inside PlotRegion3D
it shows error. So is it not possible for 3D plots in Mathematica or is there any other option specific to the 3D plot?
Thank You.