this question is related to " How can I get the (x,y) values of the line that is ploted by a contour plot (matplotlib)? " and so I use the same kind of example for my question. given:
import matplotlib.pyplot as plt
x = [1,2,3,4]
y = [1,2,3,4]
z = [[15,14,13,12],[14,12,10,8],[13,10,7,4],[12,8,4,0]]
cs = plt.contourf(x,y,z, [float(i)/10 for i in range(160)])
plt.show()
I would like to find a function that give me the z value for a given x and y. I was imagining something like this exist:
>>> cs.get_value(1.5, 1.5)
14.something
but I am not able to find an easy way to do it.