I want to plot a function of a numpy matrix
f = lambda X: X.T @ X
but I'm not sure how to proceed. I'm familiar with the method for multivariable functions, and the equivalent function with multivariable functions (along with plotting) would be
g = lambda x, y: x**2 + y**2
X, Y = np.meshgrid(
np.linspace(start = -10, stop = 10, num = 101),
np.linspace(start = -10, stop = 10, num = 101))
plt.plot_surface(X,Y,g(X,Y))
so f(np.matrix((x,y))) == g(x,y), but I don't know how to extend this to my vector function. So how can this be achieved?


(xi, yi)what is the associatedzvalue?X.T @ Xsupposed to be? It's not valid python syntax, is it?z = f(np.matrix((xi,yi)))