I have a bar chart on one y axis and a line on the second y axis which both belong to the same x axis. However, the x axis shows two entries for some values (23, 42, 200). How to remove the second one in order to have only one?
\documentclass{report}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
symbolic x coords={11, 23, 42, 200},
xlabel={Datapoint},
major x tick style = transparent,
ymin=15, ymax=32,
axis y line*=left,
bar width=20pt,
ylabel={Average Return \%},
nodes near coords,
]
\addplot[ybar, fill={rgb:black,1;white,2}] coordinates {
(11, 28)
(23, 20)
(42, 24)
(200, 29)
};
\end{axis}
\pgfplotsset{every axis y label/.append style={rotate=180,yshift=9.5cm}}
\begin{axis}[
symbolic x coords={11, 23, 42, 200},
xlabel={Datapoint},
major x tick style = transparent,
ymin=15, ymax=32,
axis y line*=right,
ylabel={Standard Deviation \%},
nodes near coords,
legend style={at={(0.2,-0.2)}, anchor=north west},
]
\addlegendimage{/pgfplots/refstyle=Hplot}
\addlegendentry{$Average\ Return$}
\addplot[smooth, dashed, mark=*, grey] coordinates {
(11, 25)
(23, 28)
(42, 19)
(200, 21)
};
\addlegendentry{$Standard\ Deviation$}
\end{axis}
\end{tikzpicture}
\end{document}

gray, notgrey, and one or two others like that). – auden Aug 12 '16 at 16:38axis y line*=right. – auden Aug 12 '16 at 16:40