1
$\begingroup$

I am trying to generate the following plot

enter image description here

What I have managed to do so far can be seen below:

p1 = Graphics[{PointSize[0.017], Red, 
    Point[{0, Tan[1.01 0 + 1.9]}]}];
p2 = Graphics[{PointSize[0.017], Red, 
    Point[{2.5, Tan[1.01 2.5 + 1.9]}]}];
mainplot = Plot[Tan[1.01 x + 1.9], {x, 0, 2.5},
   Axes -> None,
   Frame -> {{False, False}, {True, False}},
   FrameStyle -> Directive[Black],
   LabelStyle -> {Thick},
   FrameTicks -> {{None, None}, {None, None}},
   PlotStyle -> {{Thickness[0.005], Blue}},
   PlotRange -> All,
   Epilog -> {Rotate[Text[Style["C", FontSize -> 25], {1.23, 1.2}], 
      0]}];

By p1 in the code I denote the point that is the lower one; the $A_1,A_2$ and p2 is the other.

Now it is straightforward to call the above with a simple Show command

Show[mainplot, p1, p2, ImageSize -> Large]

which gives

enter image description here

There are three points that I do not understand how to do:

  1. How can I include the $A_1$ and the $A_2$ above and below the point p1 respectively. I tried to pass an Epilogue command but it did not work.

  2. How can I make an arrow in the bottom axis? Here I tired using the Arrowheads inside the FramePlotStyle but again I failed to do what I wanted.

  3. How can I include the $0$, the $r$ and the $\infty$ symbols as are in the hand-made picture? Here I had absolutely no idea how to go about it.

$\endgroup$
2
$\begingroup$

Here one way to do it combining ListPlot, Plot and Graphics

Show[{
   Plot[Tan[1.01 x+1.9]+4,{x,0,2.5},
      PlotStyle->Blue,
      Axes->{True,False},
      AxesStyle->Arrowheads[{0.0,0.05}],
      PlotRange->{{-0.25,3},{0,8}},
      Ticks->{{{0,"0"},{1.25,"r"},{2.5,"\[Infinity]"}},None}
   ],
   ListPlot[Table[{x,Tan[1.01 x+1.9]+4},{x,{0,2.5}}],PlotStyle->Red],
   Graphics[{Text["C",{1.25,5}],Text["B",{2.5,7.75}],Text["A",{0,2.}]}]
}]

Plot

$\endgroup$
3
  • $\begingroup$ This is excellent. And very elegant as well. Thanks. Can I just ask the following: is there a way of writing a second letter below the points as is shown in the hand-written image? $\endgroup$ – DiSp0sablE_H3r0 Oct 29 '20 at 13:28
  • 1
    $\begingroup$ Yes since the labels A,B,C are placed manually in the Graphics directive you could use something like Graphics[{Text["C",{1.25,5}],Text["Subscript[B, 1]",{2.45,7.75}],Text["Subscript[A, 1]",{-.1,1.4}],Text["Subscript[B, 2]",{2.6,6.9}],Text["Subscript[A, 2]",{.1,.6}]}] to get a plot with 5 labels. $\endgroup$ – N0va Oct 29 '20 at 13:57
  • $\begingroup$ Awesome, thanks again a lot! $\endgroup$ – DiSp0sablE_H3r0 Oct 29 '20 at 14:03

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.