I’m trying to Plot a graph of 1/Sqrt[x^2-4] with the asymptotes shown with Exclusions. Plot 1 below works, but Plot 2 doesn’t show any asymptotes. Why is this?
Plot 1
Plot[1/(x^2 - 4), {x, -10, 10},
Exclusions → x^2 - 4 == 0,
ExclusionsStyle → Directive[Red, Dashed],
ImageSize → 600
]
Plot 2
Plot[1/Sqrt[x^2 - 4], {x, -10, 10},
Exclusions → Sqrt[x^2 - 4] == 0,
ExclusionsStyle → Directive[Red, Dashed],
ImageSize → 600
]
This trick for plotting the asymptotes only works when there is a jump discontinuity: the exclusion will show the jump.
When the function goes to +infinity from both sides (or the functions only exists on one side) there is no jump to show.
I am afraid we have to draw those asymptotes manually, with Exclusions for example.
Plot[1/x, {x, -1, 1}, Exclusions -> x == 0,
ExclusionsStyle -> Directive[Red, Thick]]
Plot[1/x^2, {x, -1, 1}, Exclusions -> x == 0,
ExclusionsStyle -> Directive[Red, Thick]]
Plot[1/x^2, {x, -1, 1},
Epilog -> {Directive[Red, Thick, Dashed],
InfiniteLine[{{0, 0}, {0, 1}}]}]
I meant with Epilog, not with Exclusions.
I understand. Thanks very much for the reply.