3
$\begingroup$
RegionPlot[{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}, {x, 0,9}, {y, 
  0, 3}, LabelStyle ->{15,Bold,Black},PlotPoints->100, 
 Axes -> True, Frame -> True,FrameLabel->{ "|\!\(\*SubscriptBox[\(u\), \(1\)]\) / \!\(\*SubscriptBox[\(u\), \(3\)]\)|","|\!\(\*SubscriptBox[\(u\), \(2\)]\)|"
},RotateLabel -> False, FrameStyle -> Directive[Black, 10],  
 PlotStyle -> {Red, Green, Cyan, Yellow, Orange}]

I have the above code to plot a few regions. Now I want to label each regions as done in a similar image shown below. I want to add R_1 , R_2 .. exactly as shown in the picture. How can I do it in Mathematica itself? enter image description here

$\endgroup$

2 Answers 2

3
$\begingroup$
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[ℛ, #]]&/@ Range[Length[funcs]];

framelabels = TraditionalForm /@ {Abs[Row[{Subscript[u, 1], "/", Subscript[u, 3]}]], 
   Abs[Subscript[u, 2]]}

You can use the option PlotLabels:

RegionPlot[funcs, {x, 0, 9}, {y, 0, 3}, 
 PlotLabels -> Join[Placed[#,Center] & /@ labels[[;;3]],
   {Placed[labels[[4]], {{.2, 1.15}, {.5, .5}}], Placed[labels[[5]], Center]}], 
 LabelStyle -> {15, Bold, Black}, PlotPoints -> 100, 
 Axes -> True, Frame -> True, FrameLabel -> framelabels, 
 RotateLabel -> False, FrameStyle -> Directive[Black, 10],  
 PlotStyle -> {Red, Green, Cyan, Yellow, Orange}] /. Opacity[2/3]->Opacity[0]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks. You just nailed it. Except for the R_4. It is not transparent so a part of the region is not visible $\endgroup$
    – Epsilon
    Apr 22, 2020 at 18:56
3
$\begingroup$

You could try Epilog

RegionPlot[{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}, {x, 0, 9}, {y, 0, 3}, 
 LabelStyle -> {15, Bold, Black},
 PlotPoints -> 100, Axes -> True, Frame -> True,
 RotateLabel -> False, FrameStyle -> Directive[Black, 10],
 PlotStyle -> {Red, Green, Cyan, Yellow, Orange},
 ImageSize -> 400,
 Epilog -> {
   {Style[Text["R3", {2.8, 2.2}], 14]},
   {Style[Text["R5", {8, 1.2}], 14]},
   {Style[Text["R1", {.2, .2}], 10]},
   {Style[Text["R4", {.2, 1.2}], 10]},
   {Style[Text["R2", {6, 0.5}], 14]}
   }
 ]

Mathematica graphics

You can play with Style and Text to change these.

$\endgroup$
1
  • $\begingroup$ Thanks. But is it possible to get the particular font of 'R' with subscript exactly as in picture I uploaded? $\endgroup$
    – Epsilon
    Apr 22, 2020 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.