Pandas DataFrame plotting - Tick labels
<p>this is a follow-up question on a piece of code I have <a href="http://stackoverflow.com/questions/39561248/python-plotting-pandas-pivot-table-from-long-data">posted previously here</a>. </p>

<p>I am plotting a Dataframe object using <code>data_CO2_PBPROD.T.plot(marker='o', color='k', alpha=0.3, lw=2)</code> but I get on the x-axis double labels, as you can see in this picture
<a href="http://i.stack.imgur.com/eKVAx.png" rel="nofollow"><img src="http://i.stack.imgur.com/eKVAx.png" alt="enter image description here"></a></p>

<p>I tried to work on the set_major_formatter property of matplotlib.pyplot.axes() but then I get a separate graph with the correct tick labels - but no data displayed - along with the previous graph, unchanged.</p>

<p>You can use the argument <strong>xticks</strong> to set the values of your axis as explained in the documentation <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.plot.html" rel="nofollow">here</a>:</p>

<pre><code>xticks = [date for _ ,date in data_CO2_PBPROD.Column1]
</code></pre>

<p>Where <strong>Column1</strong> is the column of your DataFrame containing the tuples (Values, Year)</p>

<p>Then put the <strong>xticks</strong> as a parameter to your plot function :</p>

<pre><code>data_CO2_PBPROD.T.plot(marker='o', xticks=xticks, color='k', alpha=0.3, lw=2)
</code></pre>

python pandas matplotlib plot