title: Plot number like categorical in matplotlib
body: <p>I have a csv that looks like this:</p>
  
  <pre><code>2   1111
  4   926
  8   914
  16  933
  32  911
  64  912
  128 1010
  256 1010
  512 1013
  1024    1070
  1025    921
  1026    921
  1027    920
  1028    918
  1029    917
  1030    916
  1031    922
  1032    927
  1033    929
  1034    924
  2048    1048
  </code></pre>
  
  <p>The first column is the X and the second column is the Y.</p>
  
  <p>When I try to plot it, <strong>matplotlib</strong> will treat it as numbers thus giving interval. </p>
  
  <p>I prefer to treat the first column as categorical (<em>2, 4, 8, ..., 2048</em>) with the same distance between each x values.</p>
  
  <p>I tried converting X into categorical, but matplotlib still treat it as number:</p>
  
  <pre><code>x = pd.Series(line_data["element"]).astype("category")
  plt.scatter(x, line_data["time"])
  </code></pre>
  
  <p>I also tried converting X into string, but it got sorted thus making the graph wrong.</p>
  
  <p>What is the best approach for this problem?</p>
  
  <p>Many Thanks!</p>