a = 0.2

def fwp(x, y, a):
    return 1.0 / np.pi * np.arctan(np.sin(np.pi * y) * np.sinh(np.pi * a / 
        2.0) / (np.cosh(np.pi * x) - np.cos(np.pi * y) * np.cosh(np.pi * a /
        2.0)))
resolution = 100
xarray = np.linspace(0, 0.25, num=resolution)
yarray = np.linspace(0, 1, num=resolution)
x, y = np.meshgrid(xarray, yarray, copy=False)
A = fwp(x, y, a)
A[A <= 0] += 1
B = np.fliplr(A)
AB = np.hstack((B, A))
Setting labels manually in matplotlib contour-plot wrong