title: Matplotlib distributing the markers on a semilogx plot
body: <p>I want to plot a curve on a semilogx scale in Matplotlib. I have two vectors <code>fpr</code> and <code>tpr</code> of size 17874. I want to show markers on the same curve. But since there are too many points, I used <code>markevery=0.1</code>, as shown e.g. in <a href="https://matplotlib.org/examples/pylab_examples/markevery_demo.html" rel="nofollow noreferrer">this example</a> from the matplotlib page. However, using markevery in this case did not have any markers in the semilog plot (right panel):</p>
  
  <pre><code>fig = plt.figure(figsize=(12, 4))
  ax = fig.add_subplot(1, 2, 1)
  plt.plot(fpr, tpr, marker='o', markevery=0.1)
  ax = fig.add_subplot(1, 2, 2)
  plt.semilogx(fpr, tpr, marker='o', markevery=0.1) 
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ewWGq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ewWGq.png" alt="enter image description here"></a></p>
  
  <p>Then, I tried to use slice object. As you can see in the plot below, the markers in the left plot are evenly distributed, but in the right semilogx plot, the markers are only shown in half of the curve. So I am wondering if there is any way to have a variable slice interval that can fix this issue.</p>
  
  <p><a href="https://i.stack.imgur.com/cEOTm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cEOTm.png" alt="ROC plot on a normal scale and the semilogx"></a></p>
  
  <p>My curent code is the following:</p>
  
  <pre><code>fig = plt.figure(figsize=(12, 4))
  ax = fig.add_subplot(1, 2, 1)
  plt.plot(fpr, tpr, marker='o', markevery=slice(0, 20000, 1000))
  ax = fig.add_subplot(1, 2, 2)
  plt.semilogx(fpr, tpr, marker='o', markevery=slice(0, 20000, 1000))
  plt.show()
  </code></pre>