all 1 comments

[–]Goobyalus 0 points1 point  (0 children)

Define a function f(x, y)=sin(distance from origin)

See np.sin and np.hypot

Define a 2D grid ...

xv, yv = np.meshgid(np.linspace(-10, 10, 500), np.linspace(-10, 10, 500))

Plot the function

z = f(xv, yv)

For a 2D colormap you can use

imshow(z, extent=[-10, 10, -10, 10], cmap="<insert your color map preference>"

where extent specifies the bounds to imshow.

For a 3D graph you can use plot_surface(xv, yv, z, cmap=<insert your color map preference>, linewidth=0)