title: Polynomial fitting with log log plot
body: <p>I have a simple problem to fit a straight line on log-log scale. My code is,</p>
  
  <pre><code>data=loadtxt(filename)
  xdata=data[:,0]
  ydata=data[:,1]
  polycoeffs = scipy.polyfit(xdata, ydata, 1)
  yfit = scipy.polyval(polycoeffs, xdata)
  pylab.plot(xdata, ydata, 'k.')
  pylab.plot(xdata, yfit, 'r-')
  </code></pre>
  
  <p>Now I need to plot fit line on log scale so I just change x and y axis, </p>
  
  <pre><code>ax.set_yscale('log')
  ax.set_xscale('log')
  </code></pre>
  
  <p>then its not plotting correct fit line. So how can I change fit function (in log scale) so that it can plot fit line on log-log scale? </p>