title: How to prevent from drawing overlapping axis ticks when adding a line to scatter plot?
body: <pre><code>fig, ax = plt.subplots()
  ax = fig.add_subplot(111)
  ax.scatter(X[1],y)
  y_projection = X.dot(theta_after)
  ax.plot(X[1], y_projection)
  plt.show()
  </code></pre>
  
  <p>Above is my code. What I'm trying to do is basically fitting a line to the data. I use gradient descent method to find the suitable theta. </p>
  
  <p>The problem I came across is that the code above created two x-axis and y-axis and that they were overlapping on each other</p>
  
  <p><a href="https://i.stack.imgur.com/ZJ8K4.png" rel="nofollow noreferrer">This is the result generated from the above code. I'm not allowed to embed a pic now, please click on this to open the pic.</a></p>
  
  <p>X - is a 97*2 matrix in which the first column is all 1.</p>