title: how to plot line of best fit using loglog in python matplotlib
body: <p>Using this code:</p>
  <pre><code>x = np.array([1, 2, 7, 5, 8])
  y = np.array([ 5, 4, 6, 7, 10 ])
  x = np.log(x)
  y = np.log(y)
  m, b = np.polyfit(x, y, 1)
  plt.plot(x, y, 'o')
  plt.plot(x, m*x + b)
  </code></pre>
  <p>I can make a plot of log value as follow:
  <a href="https://i.stack.imgur.com/QjPfM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QjPfM.png" alt="enter image description here" /></a></p>
  <p>But I want to have the axis ticks in non log-value, so I thought this would work:</p>
  <pre><code>x = np.array([1, 2, 7, 5, 8])
  y = np.array([ 5, 4, 6, 7, 10 ])
  m, b = np.polyfit(x, y, 1)
  plt.loglog()
  plt.plot(x, y, 'o')
  plt.plot(x, m*x + b)
  </code></pre>
  <p>But I got this instead:</p>
  <p><a href="https://i.stack.imgur.com/M9C1S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M9C1S.png" alt="enter image description here" /></a></p>
  <p>How do I make a best fit line in log scale  but with non log axis ticks?</p>