I am using pgfplots for crystallographic data analysis. I can effectively use yshift
to shift plots within the axis environment, however, the legend entry line reference also shifts. I originally intended to use pgfplotstable to simply add or subtract from every data point to shift but this was computationally intensive (many data points). Excuse the constant plot hack to have a drop-down plot. Representative Code (courtesy of commenter):
\documentclass{standalone}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotsset{compat = 1.13}
\pgfplotstableset{col sep = comma}
\begin{document}
\pgfplotstableread{
20, 1000
70, 500
}{\data}
\begin{tikzpicture}
\begin{axis}
\addplot[black] table[x index = 0, y index = 1, col sep = comma] {\data};
\addlegendentry[]{040\_Mn}
\addplot[red!20!blue] table[x index = 0, y expr={\thisrowno{1} - 500}] {\data};
\addlegendentry[]{023\_Mn}
\addplot[yshift=-2cm,red!20!blue] table[x index = 0, y index=1] {\data};
\addlegendentry[]{035\_Mn}
\addplot[yshift = -5cm, red!30!blue] expression {x^2};
\end{axis}
\end{tikzpicture}
\end{document}
\addplot[red!20!blue] table[x index = 0, y expr={\thisrowno{1} - 500}] {\twentythreeMn};
was very slow?\pgfplotstable
, which in some cases went over memory. With this method it is approximately 1 minute per graph. Thank you! This works because I can do formatting using the keyeach nth point
and then do a final run with all data points. In the future I thought of doingxshift
and additional manipulation likescale
treating theaddplot
as a layer within theaxis
environment. Can we separate the plot styling from its legend entry? Attempting to reciprocally shift the legend entry doesn't work.yshift
anywhere. I mean either add the datafiles, or use some dummy data, e.g. as in bitbucket.org/snippets/torbjornt/ogExK