For plots with a lot of points it often looks very crowded if each point has its own error bar. Is there an easy way to only draw certain error bars in pgfplots? I could not find any option besides drawing the data twice. So in short: is there a command such as error mark indices
or a similar option to influence the drawing of error marks?
Here is my MWE, this is basically how it should look like:
\documentclass[tikz,preview]{standalone}
\usepackage{tikz,pgfplots,filecontents}
\pgfplotsset{compat=1.7}
\begin{filecontents*}{data.dat}
X Y Y_error
1 1.39 0.1
2 2.44 0.1
3 3.62 0.1
4 4.81 0.1
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
clip mode=individual,
]
\addplot+[each nth point=4,forget plot,error bars/.cd,y dir=both,y explicit]
table[x=X,y=Y,y error=Y_error] {data.dat};
\addplot+[] table[x=X,y=Y,y error=Y_error] {data.dat};
% these command do not seem to exist:
% error mark repeat=4
% error mark indices={1}
\end{axis}
\end{tikzpicture}
\end{document}