TransWikia.com

Using Epilogue in the Grpahics environment and labelling an axis in Frame

Mathematica Asked on February 2, 2021

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.

One Answer

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

Answered by N0va on February 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP