Your theta and phi were essentially 1D rather than 2D, so it didn't allow
for 2 degrees of freedom. And you don't need np.outer() for this:
theta = np.linspace(0, np.pi, 500)[:, None]
phi = np.linspace(0, 2*np.pi, 500)[None, :]
r = f(theta, phi)
x = r**2 * np.cos(phi) * np.sin(theta)
y = r**2
Dear experts,
I am trying to plot spherical harmonics with matplotlib and I have some
troubles. I am starting from the example
http://matplotlib.org/examples/mplot3d/surface3d_demo2.html where I
change the factor 10 in a function of r=f(theta,phi) (or r=f(u,v) as
they are named in the example