I have the graph y = tan(x) and I want to remove the vertical lines (see below).
y = tan(x)
Here is my code:
import numpy as np import matplotlib.p
Use the definition of tan, sin/cos. The vertical asymptotes will happen when cos = 0, so write a conditional statement such as: if cos(x) != 0: plt.plot(x, np.tan(x))