Consider this MWE:
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usetikzlibrary{pgfplots.groupplots}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}[
group style={
group name=my plots,
group size=1 by 3,
xlabels at=edge bottom,
xticklabels at=edge bottom,
vertical sep=5pt,
},
height=3cm,
ymin=1,
ymax=3,
]
\nextgroupplot[,
ytick={1,2,3},
% yticklabel style={yshift=1mm}, % apply this only to tick at 1
]
\addplot[color=red,mark=x] coordinates {
(2,1)
(3,2)
(4,3)
};
\nextgroupplot[,
ytick={1,2,3},
% yticklabel style={yshift=-1mm}, % apply this only to tick at 3
]
\addplot[color=red,mark=x] coordinates {
(2,1)
(3,2)
(4,3)
};
\end{groupplot}
\end{tikzpicture}
\end{document}
Output:
Problem statement:
I would like to prevent the overlap of the two ticks "1" and "3" by shifting those labels a little bit vertically each.
My approach was to adapt the yticklabel style
. Unfortunately I found no way to only adapt the style of a single tick.
A manual solution is fine by many -- I do not need an automatic ticklabel overlap prevention.