2
$\begingroup$

Here is my code:

h[θ_] := (1 - θ)/θ
x = Plot[{h[θ], 2.5}, {θ, 0.1, 1}, 
  PlotTheme -> "Monochrome",
  AxesLabel -> {"θ", "h(θ)"}, 
  PlotLegends -> Placed[{"h(θ)", "\!\(\*OverscriptBox[\(θ\), \(^\)]\)"}, Below], 
  LabelStyle -> {FontSize -> 10},
  Epilog -> {PointSize[0.01], Black, Point[{{0.2, 4}, {0.25, 3}, {0.4, 1.5}, {0.5, 1}}]}]

I want to label these 4 points as A,B,C,D, respectively. I tried to implement the answer from here, but I got lost with Map, Transpose, etc.

So, I would appreciate any help

$\endgroup$
3
$\begingroup$

No Map, no Transpose, no etc.

h[θ_]:=(1-θ)/θ;
x=Plot[{h[θ],2.5},{θ,0.1,1},
  Epilog->{
    Point[{0.2,4}],Text["A",{0.2,4},{-1,-1}],
    Point[{0.25,3}],Text["B",{0.25,3},{-1,-1}],
    Point[{0.4,1.5}],Text["C",{0.4,1.5},{-1,-1}],
    Point[{0.5,1}],Text["D",{0.5,1},{-1,-1}]
}]

There. See how much easier that is to understand.

| improve this answer | |
$\endgroup$
6
$\begingroup$

With Callouts and combining a separate ListPlot using a Show:

h[θ_] := (1 - θ)/θ
Show[
 Plot[{h[θ], 2.5}, {θ, 0.1, 1}, 
  PlotTheme -> "Monochrome", AxesLabel -> {"θ", "h(θ)"},
   PlotLegends -> Placed[{"h(θ)", "\!\(\*OverscriptBox[\(θ\), \(^\)]\)"}, Below], 
  LabelStyle -> {FontSize -> 10}],
  With[{pts = {{0.2, 4}, {0.25, 3}, {0.4, 1.5}, {0.5, 1}}, labels = {"A","B","C","D"}},
    ListPlot[Thread[Callout[pts, labels]]]
  ]
 ]

plot with callouts

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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