title: Obtain plot data from JPEG or png file
body: <p>I'm writing a program that obtains plot data from a graph(JPEG).
  Vertical axis is logarithmic.
  I successfully made a program that understands horizontal and vertical axes as linear (not logarithmic), see the code below:</p>
  
  <h2><img src="https://i.stack.imgur.com/Qx3JF.png" alt="enter image description here"></h2>
  
  <pre><code>%matplotlib inline
  
  from PIL import Image
  from scipy import *
  from pylab import *
  
  im = array(Image.open('fig1.jpg'))
  
  hh = im.shape[0]
  ww = im.shape[2]
  
  imshow(im)    
  print(im[100,0,:])
  
  Col = array([255,0,0])#赤
  bnd = 30
  
  yax = linspace(0.5,2e-4,hh)
  xax = linspace(1,14,ww)
  
  for i in range(hh):
      for j in range(ww):
          im[i,j,:] = 255*(any(im[i,j,:]&gt;Col+bnd) or any(im[i,j,:]&lt;Col-bnd))
  
  mapim = abs(im[:,:,0]/255-1).astype(bool)
  
  yval = array([average(yax[mapim[:,t]]) for t in range(ww)])
  
  rlt = interp(range(100),xax,yval)
  </code></pre>
  
  <p>I have no idea how to modify it to make it understand logarithmic axis.
  Please help me.</p>