I would like to know how to use matplotlib to graph functions similar to how it would be done in Desmos:
With the graph centered at the center of the screen
With axis centered at the center of the screen
With the function being graphed relative to the center of the screen (origin)
- If possible, I would like to be able to set the boundaries of the axis
My Current Code:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-100,100, 100)
y = x**2
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.set_title('centered spines')
ax.spines['left'].set_position('center')
ax.spines['bottom'].set_position('center')
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
