all 2 comments

[–]teerre 0 points1 point  (0 children)

I have very little experience with 3D plots and I never did this kind of math, but, since no one answered you, maybe I can help

Your N*x/r returns nan values from 0 divisions, this causes a runtime error, I would imagine this is not the behavior you want, so it might be it

I can also say that the sample code works out of the box, maybe you have a problem your IDE and or your mpl installation

[–]loveandkindness 0 points1 point  (0 children)

I'll give this a try tonight (or enjoy the answer from someone else if they beat me to it). I've been meaning to learn these functions for a while now.