title: How can I move a tick label only(without moving corresponding tick)?
body: <p>I'm using matplotlib to generate a diagram, and I use <code>set_ticks</code> and <code>set_ticklabels</code> to mark out several important values on the x-axis. But some of these labels are too close and get overlapped. But I don't know how to move these labels without moving the ticks.</p>
  
  <p>Here is an illustration:</p>
  
  <p><img src="https://i.stack.imgur.com/psnZs.png" alt="overlapped tick labels"></p>
  
  <p>I have tried several tricks but failed, and I haven't found an answer to this question on the Internet. Any help, thanks.</p>
  
  <hr>
  
  <h2>Update:</h2>
  
  <p>The source code:</p>
  
  <pre><code>fig = mpl.figure( figsize=(3, 3) )              # force figsize here to reproduce the problem.
  ax = fig.add_subplot(1, 1, 1, frameon=False)
  ax.set_xlim(-0.015, 1.515)
  ax.set_ylim(-0.01, 1.01)
  ax.set_xticks([0, 0.3, 0.4, 1.0, 1.5])
  ax.grid(True)
  mpl.show()
  </code></pre>
  
  <p>And the result:</p>
  
  <p><img src="https://i.stack.imgur.com/PF8af.png" alt="enter image description here"></p>
  
  <p>I have tried several tricks and the best one is:</p>
  
  <pre><code>fig = mpl.figure( figsize=(3, 3) )
  ax = fig.add_subplot(1, 1, 1, frameon=False)
  ax.set_xlim(-0.015, 1.515)
  ax.set_ylim(-0.01, 1.01)
  ax.set_xticks([0, 0.3, 0.4, 1.0, 1.5])
  ax.set_xticklabels([0.0, "", "", 1.0, 1.5])
  ax.set_xticks([0.35], minor=True)
  ax.set_xticklabels(["0.3 0.4"], minor=True)
  ax.grid(True)
  mpl.show()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Y2vtu.png" alt="enter image description here"></p>
  
  <p>But there is a minor tick at x = 0.35 and I don't know how to remove it.</p>
  
  <hr>
  
  <h2>Update 2:</h2>
  
  <p>OK, I found how to remove minor ticks myself:</p>
  
  <pre><code>for line in ax.xaxis.get_minorticklines():
      line.set_visible(False)
  </code></pre>
  
  <p>In this manner, we can utilize minor ticks to put tick labels anywhere we want.</p>
  
  <p>Thanks to all warm-hearted!</p>