import numpy as np
import matplotlib.pyplot as plt
[x, y] = np.meshgrid(np.linspace(-5, 5), np.linspace(-5, 5))
def f(x):
...
z = f(x, y)
fig = plt.figure(1)
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(x, y, z)
plt.title('Fläche')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
plt.show()