title: Renaming X-Axis Labels when using Matplotlib and Pandas
body: <p>I'm running my code on iPython Notebooks, on a Macbook Pro Yosemite 10.10.4</p>
  
  <p>I have a CSV file that I am trying to read using Python, and looking to come up with charts. The problem I am facing is renaming the X-Axis labels. </p>
  
  <p>Essentially, the chart is trying to plot a count of different types of Audit Violations, but has really long descriptions of the said violations. For example:</p>
  
  <ul>
  <li>Not approved by regional committee.......another 300 words - 17</li>
  <li>No contract with vendor.......another 300 words - 14</li>
  <li>Vendor Registration not on record.......another 300 words - 9</li>
  </ul>
  
  <p>Instead of having these verbose reasons though, I would like to rename the X-Axis labels to just numbers or alphabets so that the graph reads somewhat like this:</p>
  
  <ul>
  <li>A - 17</li>
  <li>B - 14</li>
  <li>C - 9</li>
  </ul>
  
  <p>This is the code I have used, and except for the label names, I am happy with the result.</p>
  
  <pre><code>%matplotlib inline
  import pandas as pd
  import matplotlib.pyplot as plt
  import numpy as np 
  import pylab as pl
  pd.set_option('display.mpl_style', 'default') 
  pd.set_option('display.width', 5000) 
  pd.set_option('display.max_columns', 60)
  plt.rcParams['figure.figsize'] = (15, 5)
  fixed_data = pd.read_csv('audit-rep.csv',sep=',',encoding='latin1',index_col='Index', parse_dates=['Report Date'],dayfirst=False)
  
  viol_counts = data['Audit Flag'].value_counts()
  viol_counts[:10]
  viol_counts[:10].plot(kind='bar')
  </code></pre>
  
  <p>I have tried to rename the x-axis labels using the code below.</p>
  
  <pre><code> viol_counts.set_ylabel('No. of Violations')
   viol_counts.set_title('Audit Results')
   viol_counts.set_xticks(ind+width)
   viol_counts.set_xticklabels( ('A', 'B','C') )
  </code></pre>
  
  <p>This is the error I get when using the above code.</p>
  
  <blockquote>
    <p>AttributeError: 'Series' object has no attribute 'set_ylabel'</p>
  </blockquote>
  
  <p>I have come across a few other posts related to this issue, but not seen one that specifically addresses the renaming of individual labels.
  This isn't utterly important though, and I'm just trying to learn using python, and the actual work has been done in excel.</p>