title: Find a value from x axis that correspond to y axis in matplotlib python
body: <p>I am trying to do simple task such as to read values of x axis that corresponds to value of y axis in matplotlib and I cannot see what is wrong. </p>
  
  <p>In this case I am interested for example to find which value for y axis I get if I choose x=2.0, but I get <code>idx</code> tuple empty even there is number 2 in <code>xvalues</code> array. </p>
  
  <p>This is the code:</p>
  
  <pre><code>pyplot.plot(x,y,linestyle='--',linewidth=3)
  
  ax = pyplot.gca()
  
  line = ax.lines[0]
  
  xvalues = line.get_xdata()
  
  yvalues = line.get_ydata()
  
  idx = where(xvalues == 2.0) 
  
  y = yvalues[idx[0][0]]
  </code></pre>
  
  <p>This is the <code>xvalues</code> array:</p>
  
  <pre><code>[1.40000000e+00   1.45000000e+00   1.50000000e+00   1.55000000e+00
  1.60000000e+00   1.65000000e+00   1.70000000e+00   1.75000000e+00
  1.80000000e+00   1.85000000e+00   1.90000000e+00   1.95000000e+00
  2.00000000e+00   2.05000000e+00   2.10000000e+00   2.15000000e+00
  2.20000000e+00   2.25000000e+00   2.30000000e+00   2.35000000e+00]
  </code></pre>