Ask Your Question
4

What can be done to prevent matplotlib from including extraneous lines at vertical asymptotes?

asked 2021-04-20 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-01-13 21:00:00 +0000

lalupa gravatar image

One way to prevent matplotlib from including extraneous lines at vertical asymptotes is by setting the ylim parameter to a smaller range that does not include the asymptote. For example, if the asymptote is at x=2, and the plot ranges from x=0 to x=4, the ylim can be set to (0,10) to exclude the asymptote. Another way is to use the nan function to create gaps in the plot at the asymptote. This can be accomplished by setting the y-values to nan when the x-value is at the asymptote.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-04-20 11:00:00 +0000

Seen: 7 times

Last updated: Jan 13 '23