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.
Asked: 2021-04-20 11:00:00 +0000
Seen: 7 times
Last updated: Jan 13 '23