Message Boards Message Boards

0
|
3078 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

What's the difference between these two Exclusions / Asymptotes?

Posted 9 years ago

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 ]

POSTED BY: H FR
3 Replies

I meant with Epilog, not with Exclusions.

POSTED BY: Gianluca Gorni

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}}]}]
POSTED BY: Gianluca Gorni
Posted 9 years ago

I understand. Thanks very much for the reply.

POSTED BY: H FR
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract