title: How to get the X, Y values from the given Z value after using interpolate.interp2d to plot a surface
body: <p>I have x and y arrays to represent the row and column of a grid data and its values are in the z 2d array. 
  I have used interpolate.interp2d to plot a surface graph.
  Now, I am able to obtain the z value for given x, y value but I want to be able to obtain the x,y values from the given z value.</p>
  
  <p>code:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from matplotlib import cm
  from mpl_toolkits.mplot3d import Axes3D
  from scipy import interpolate
  
  x = [0, 0.01, 0.02]
  y = [0, 5e-05, 0.0001]
  print(np.meshgrid(x, y))
  xx, yy = np.meshgrid(x, y)
  z = [[ 1.    ,      0.99990035,  0.99981654],
   [ 0.90849264,  0.85447203,  0.81382534],
   [ 0.82880434 , 0.76083003 , 0.71961281]]
  f = interpolate.interp2d(x, y, z, kind='linear')
  xnew = np.arange(x[0],x[2], 1e-6)
  ynew = np.arange(y[0],y[2], 1e-6)
  
  znew = f(xnew, ynew)
  print(f(0.003,0.0006))
  xnew,ynew=np.meshgrid(xnew,ynew)
  
  fig = plt.figure()
  ax = fig.gca(projection='3d')
  
  ax.plot_surface(xnew,ynew, znew,
                         cmap=cm.get_cmap('coolwarm'))
  
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/SVW0B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SVW0B.png" alt="enter image description here"></a></p>