How can I plot a contour map on the xy plane rather than on the 3d surface of the function?
This is my current output:
def f(x,y):
return x**2 + y**2
x = np.linspace(-10,10,100)
y = np.linspace(-10,10,100)
X,Y = np.meshgrid(x,y) # array of values containing all value pairs (xi, yi)
Z = f(X,Y)
fig = plt.figure()
ax = plt.axes(projection='3d')
ax.plot_surface(X, Y, Z, cmap="autumn_r", rstride=1, cstride=1)
ax.contour(X, Y, Z, 10, cmap="autumn_r", linestyles="solid")
plt.show()