For example, I have such set of complex points:

and I want to plot an image of function (for example, f(z) = -cos(z)) from the preimage:

Here is my code for this:
from numpy import *
import matplotlib.pyplot as plt
z_0 = []
N = 500
u = linspace(0.0, pi, N)
v = linspace(0.0, 15.0, N)
for i in xrange(N):
for j in xrange(N):
z_0.append(u[i] + 1j * v[j])
z = -cos(z_0)
plt.plot(real(z), imag(z), linestyle='', marker='x')
plt.grid(True)
plt.show()
Can I get rid of two nested loops? Is there any better way to solve the problem using numpy/matplotlib standard functions?
You could use numpy.meshgrid: