-1

I have a figure, which is some polynomial, and I want to have visible axes so I can see where it passes through y axis. plt.axes() isn't what I want, it's rather about axes that are the borders of your graph. I could simply plt.plot() the axes the way I need, but I don't think this is the best way. My code:

X = np.linspace(-100, 100, 1000)
Y = [f(i) for i in X]
plt.plot(X, Y)
plt.axes() // Does nothing since I already have default axes
plt.show()
Martian
  • 227
  • 1
  • 15

1 Answers1

1

Hope this is what you asked for ?



  

        X = np.linspace(-100, 100, 1000)
        Y = [(i) for i in X]
        plt.plot(X, Y)
        plt.grid("whitegrid") 
        plt.axhline(0,color="red") 
        plt.axvline(0,color="red") 
        plt.text(-10,-10,[0,0]) 
        plt.show()

for the figure that i have drawn through code please click here