title: Missing textual labels along x-axis when using Matplotlib (line-plot) with data from a Pandas dataframe
body: <p>I am trying to plot data from a Pandas dataframe that is created by importing data from a CSV. However in the plot not every label is displayed along the x-axis, the plot only shows 5 labels along the x-axis. </p>
  
  <p>I have a total of 22 textbased labels, which are all supposed to be shown along the x-axis as tickmarks/labels. These labels correspond to the entries in the column in the dataframe with the name Category. </p>
  
  <p>For each Line in the Line column of the dataframe a separate line in the plot is created. And the Amount columns in the dataframe contains the y-values.</p>
  
  <p>I am sure there is a easy tweak for this, trying <code>ax.set_xticks(np.arange(len(21))</code> and
  <code>plt.xticks( arange(21) )</code> did not function, maybe because the labels are textbased, not numbers?     </p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>I had some trouble with the initial code after changing computer with another software setup. Now I got another version of the code and CSV that I got to run without problems that actually plots a graph. Now back to the initial problem, as can be seen from the attached picture only a few of the categories (gts, jma, yja, lre, fgg) are displayed as labels along the x-axis (I want all 22 categories to be displayed along the x-axis in full text):
  <a href="https://i.stack.imgur.com/N1ie3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N1ie3.png" alt="Image of the plot that does not display all the categories as x-labels along the x-axis"></a></p>
  
  <p>Here is the code that I used for plotting that doesn't display all x-labels:</p>
  
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  
  df=pd.read_csv("import.csv", 
                     names=["Category", "Line", "Amount"], encoding="iso-8859-1")
  
  fig, ax = plt.subplots(1,1);
  df.groupby("Category").plot(x="Line", y="Amount", ax=ax)
  
  plt.legend([v[0] for v in df.groupby('Category')['Category']], bbox_to_anchor=(1.1, 0.5)) 
  plt.xlabel('Category')
  plt.ylabel('Amount')
  
  for line in ax.lines:
      line.set_linewidth(0.5)
  </code></pre>
  
  <p>The CSV contents look as follows, I didn't post the whole file as there are many lines. I believe this should be enough to reproduce the problem (of course I can put more if the plot doesn't work without). The first column is the Line-column, the second column corresponds to the Category-column and the third column corresponds to the Amount-column:</p>
  
  <pre><code>jabber,gts,1
  jabber,aed,6
  jabber,ame,2
  jabber,asy,8
  jabber,fxk,1
  jabber,jma,6
  jabber,oaw,2
  jabber,ejt,8
  jabber,qat,1
  jabber,dzj,6
  jabber,yja,2
  jabber,ajz,8
  jabber,jbp,1
  jabber,bvi,6
  jabber,pec,2
  jabber,lre,8
  jabber,wlx,1
  jabber,hpw,6
  jabber,spg,2
  jabber,bdg,8
  jabber,fgg,1
  jabber,fgz,5
  soshy,gts,6
  soshy,aed,2
  soshy,ame,8
  soshy,asy,1
  soshy,fxk,6
  soshy,jma,2
  soshy,oaw,8
  soshy,ejt,1
  soshy,qat,6
  soshy,dzj,2
  soshy,yja,8
  soshy,ajz,1
  soshy,jbp,6
  soshy,bvi,2
  soshy,pec,8
  soshy,lre,1
  soshy,wlx,6
  soshy,hpw,2
  soshy,spg,8
  soshy,bdg,1
  soshy,fgg,6
  soshy,fgz,2
  </code></pre>