I was looking through how to smooth a 3d graph in Smooth surface Plot with Pyplot. In the answer portion, the user has a piece of code that looks like this:
np.mgrid[-1:1:80j, -1:1:80j]
I understand that np.mgrid
creates a grid. I understand that the range for the x and y of the above grid would be from -1 to 1 for both axes. But I do not understand the 80j portion. Could someone please explain it to me?
Edit: For anyone else who stumbled on this question: 80j is an imaginary or complex number. np.mgrid
takes the real portion of the value and creates that many points within the range (ends inclusive). See the link in one of the comments below. So this would create 80 points between -1 and 1.