This is the expected behavior.
It selects the closest contour curve for each coordinate of the x, y data contained in the manual parameter. When the same contour curve is detected for many coordinates, it may happen that they begin to agglomerate, as in your case.
If you used:
y_pick = [0.01, 0.025, 0.05, 0.075, 0.1, 0.15, 0.2, 0.3, 0.5] labelpos = ((0, i) for i in y_pick)
you will get something like:

From the topic:
you can vectorize your code by avoiding relatively slow for loops:
import numpy as np import matplotlib.pyplot as plt a = 0.2 def fwp(x, y, a): return (1./np.pi*np.arctan(np.sin(np.pi*y)*np.sinh(np.pi*a/2.)/ (np.cosh(np.pi*x)-np.cos(np.pi*y)*np.cosh(np.pi*a/2.)))) 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))
source share