Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.