I trying to plot a graph of a function f(x, y) = x**x*y, but I'm getting an error: import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D def f(x,y): return x**x*y x = np.arange(-4.0, 4.0, 0.1) y = np.arange(-4.0, 4.0, 0.1) z = f(x, y) X, Y, Z = np.meshgrid(x, y, z) fig = plt.figure() ax = Axes3D(fig) ax.plot_surface(X, Y, Z) plt.xlabel('x') plt.ylabel('y') plt.show() First error is: /usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:2: RuntimeWarning: invalid value encountered in power And the second is: ValueError: Argument Z must be 2-dimensional. Continue reading...