# PgfPlots duplicate x-axis labels

I have some repeated numbers on my X-Axis. Here is my code-

\begin{tikzpicture}
\datatable
\begin{axis}[symbolic x coords={1.2.1.a,1.2.3.b,1.1.3.c,1.1.1.d,1.3.1.e,1.3.3.f,3.3.3.g,1.3.3.h,1.1.3.i,1.1.1.j,1.2.1.k,1.3.1.l},
x tick label style={rotate=90,anchor=east},
grid=major,
xlabel=Processor Configuration,
ylabel=Clock Cycles,
legend pos=outer north east,
legend columns=1,
cycle list name=exotic,
%xtick=data,
xticklabels={1.2.1,1.2.3,1.1.3,1.1.1,1.3.1,1.3.3,3.3.3,1.3.3,1.1.3,1.1.1,1.2.1,1.3.1},
x label style={at={(0.5,-0.1)}},
]
\end{axis}
\end{tikzpicture}


And here is my data file -

Proc_config App_Stop
1.2.1.a     138
1.2.3.b     923
1.1.3.c     1708
1.1.1.d     923
1.3.1.e     138
1.3.3.f     923
3.3.3.g     923
1.3.3.h     1427
1.1.3.i     923
1.1.1.j     923
1.2.1.k     138
1.3.1.l     923


Now you can see I have 2 entries for example for 1.2.1 renamed as 1.2.1.a and 1.2.1.k. So in order to avoid these a,b,c...,l in the x-axis tick labels I have added the command xticklabels= in the code. However, it does not display every label I have added. However, if I comment this line and uncomment the xtick=data line, I get the correct output, however it has all the suffixes a,b,c...l for every entry. How can I overcome this situation?

-
Instead of setting the position for the x label manually, you can just use \pgfplotsset{compat=1.5.1} (or newer, seeing that version 1.6 has just come out). That will set the label position to automatically take the length of the tick labels into account., –  Jake Aug 27 '12 at 13:05
cool :) thanks for pointing it out. –  Raj Aug 27 '12 at 13:11

This gives the desired output:

\documentclass{article}
\usepackage{pgfplots}
\begin{document}

\begin{tikzpicture}
\datatable
\begin{axis}[symbolic x coords={1.2.1.a,1.2.3.b,1.1.3.c,1.1.1.d,1.3.1.e,1.3.3.f,3.3.3.g,1.3.3.h,1.1.3.i,1.1.1.j,1.2.1.k,1.3.1.l},
x tick label style={rotate=90,anchor=east},
grid=major,
xlabel=Processor Configuration,
ylabel=Clock Cycles,
legend pos=outer north east,
legend columns=1,
cycle list name=exotic,
xtick=data,
xticklabels={1.2.1,1.2.3,1.1.3,1.1.1,1.3.1,1.3.3,3.3.3,1.3.3,1.1.3,1.1.1,1.2.1,1.3.1},
x label style={at={(0.5,-0.1)}},
]
\end{axis}
\end{tikzpicture}

\end{document}


-
You just uncommented xtick=data, right? –  Jake Aug 27 '12 at 13:05
@Jake yes; that's all I did. –  Gonzalo Medina Aug 27 '12 at 13:06
oops... really simple. :) Thank You ! –  Raj Aug 27 '12 at 13:08