c = np.cos(20)**2
d = np.sin(20)**2
x = np.linspace(-np.pi,np.pi)
y = np.linspace(-np.pi, np.pi)
z = np.abs(np.cos(20 * (c + d)))
x,y = np.meshgrid(x,y)
plt.imshow(z)
So this is the code so far. It's supposed to produce a plasma effect
c = np.cos(20)**2
d = np.sin(20)**2
x = np.linspace(-np.pi,np.pi)
y = np.linspace(-np.pi, np.pi)
z = np.abs(np.cos(20 * (c + d)))
x,y = np.meshgrid(x,y)
plt.imshow(z)
So this is the code so far. It's supposed to produce a plasma effect
Not sure if this is what you were trying, but here is an example of code that works without the error. Maybe you can tweak it to your liking:
from matplotlib import pyplot as plt
def z_function(x,y):
c = np.cos(x)**2
d = np.sin(y)**2
z = np.abs(np.cos(20 * (c + d)))
return z
x = np.linspace(-np.pi,np.pi)
y = np.linspace(-np.pi, np.pi)
xx,yy = np.meshgrid(x,y)
Z = z_function(xx,yy)
plt.imshow(Z)