3
$\begingroup$

I want to plot some functions where one of them is and a vertical asymptote but it cannot put into the Legend (the asymptote is 1 ). Also, another problem is when trying to improve the axis size and font. It does not show the asymptote which value is 1.

Fig1 = LogPlot[{ t^2/4, (8 t^3)/27, (81 t^4)/256 }, {t, 0, 1}, 
  PerformanceGoal -> "Quality", 
  PlotLegends -> {"q=1/2 ", "q=2/3", "q=3/4"}, 
  LabelStyle -> Directive[Bold, FontFamily -> "Arial"], 
  FrameLabel -> {"\[Tau]", "Log r"}, 
  Epilog -> InfiniteLine[{{1, -2}, {1, 2}}], 
  PlotStyle -> {Black, Directive[Dashing[0.002], Black], 
    Directive[Dashing[0.00], Black], 
    Directive[Dashing[0.03], Black] }, Frame -> True, 
  PlotRangePadding -> 0, LabelStyle -> Directive[33], 
  FrameStyle -> Thick]
$\endgroup$
1
$\begingroup$

Maybe something like:

plotstyles = {Black, Directive[Dashing[0.002], Black], Directive[Dashing[0.03], Black]};

LogPlot[{t^2/4, (8 t^3)/27, (81 t^4)/256}, {t, 0, 1}, 
 PerformanceGoal -> "Quality", 
 PlotLegends -> LineLegend[Append[plotstyles, Dotted],
  {"q=1/2 ", "q=2/3", "q=3/4", "vertical line"}], 
 LabelStyle -> Directive[Bold, FontFamily -> "Arial"], 
 FrameLabel -> {"τ", "Log r"}, 
 Epilog -> {Dotted, InfiniteLine[{{1, -2}, {1, 2}}]}, 
 PlotStyle -> plotstyles, Frame -> True, 
 PlotRangePadding -> {{0, Scaled[.05]}, {0, 0}}, 
 FrameStyle -> Thick]

enter image description here

where I used

  1. PlotRangePadding -> {{0, Scaled[.05]}, {0, 0}} to extend the domain so that the vertical line is visible.
  2. LineLegend[...] to specify the styles and labels for all the lines including the vertical line.
$\endgroup$
  • $\begingroup$ @irondonio, does this answer your question? $\endgroup$ – kglr Jul 8 at 6:52

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.