Hi

I am using contour plot but I am facing the issue that it is plotting the points where the function is undefined. For example, I am using a rational function and it has a discontinuity in y = 1(red horizontal line.

Is there any way to avoid this?

import matplotlib.pyplot as plt

import numpy as np

k=2.5

def R(x,y):

return 1-((x*(k+1))/((y+k)*(1-y)))

x = np.linspace(0,1.3,500)

y = np.linspace(0,2.5,500)

X, Y = np.meshgrid (x, y)

plt.contour(X, Y, R(X, Y), [0], colors=â€˜râ€™)

plt.show()