I need to shift several curves in a plot but in a way that is independent of the scale of the data. For example I need to shift each curve by a fifth or so of the scale of plot.
Suppose one has to plot several curves that are very similar:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot+[
] coordinates{
( 1, 2 )
( 2, 3 )
( 3, 4 )
};
\addplot+[
] coordinates{
( 1, 2.1 )
( 2, 2.9 )
( 3, 4.1 )
};
\end{axis}
\end{tikzpicture}
\end{document}
A common technique (if the background level is obvious) is to use a Y-offset. Like here: 
The obvious way would be to add a filter to shift the data (like below). However all the filters modify the data in a data coordinates not in units relative the axis size on paper.
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot+[
y filter/.code={\pgfmathparse{#1+0.0}\pgfmathresult}
] coordinates{
( 1, 2 )
( 2, 3 )
( 3, 4 )
};
\addplot+[
y filter/.code={\pgfmathparse{#1+0.5}\pgfmathresult}
] coordinates{
( 1, 2.1 )
( 2, 2.9 )
( 3, 4.1 )
};
\end{axis}
\end{tikzpicture}
\end{document}
How can I shift the data (e.g. in the Y-direction) in proportion to the size of the axis?
I found this answer here after posting: How to do a shift/offset of ycomb or ybar **in y-direction** without stacking in pgfplots? , but it has problem as it also shifts the point in the legend!
legendentry. – alfC Mar 12 '15 at 17:08\addplot [yshift=0.5\currentyaxislength, ...– alfC Mar 12 '15 at 17:10\def\myheight{5cm}and use that to set theheightof the axis and to shift your plot. – Jake Mar 12 '15 at 17:16\addplot[curve draw style={yshift=1cm}]so the shift doesn't have to be repeated. no? – alfC Mar 12 '15 at 17:35\pgfplotsset{shift plot/.style={yshift=#1, legend image post style={yshift=-#1}}}. Then you can shift the plot by settingshift plot=1cm. – Jake Mar 12 '15 at 17:38