I am using pgfplots to render the figures in my manuscript. The figures are kept in separate .tikz-files. Each figure contains data from multiple samples, 1 plot per sample. The measurements of multiple samples is obviously so as to demonstrate the reproducibility of the experiment. As the data of those samples agree well with each other, for clarity I would rather only show the plot of 1 sample. However, the full figure should go to the Appendix.
To do so, I needed a way to select the plots shown from a single .tikz-file, so I do not need to duplicate the file and I only need to make future adjustments to the one file.
main tex file
\documentclass{article}
\usepackage{pgfplots}
\usepackage{lipsum}
\usepackage{graphicx}
\begin{document}
\section{results}
%% a switch so only one sample is shown
\begin{figure}[h]
\input{greatfigure.tikz}
\end{figure}
\section{Appendices}
%% a switch so all samples is shown
\begin{figure}[h]
\input{greatfigure.tikz}
\end{figure}
\end{document}
great figure.tikz
\begin{tikzpicture}
\begin{axis}[
width=8.5cm,
height=8.5cm,
xmin=0,xmax=10,ymin=0,ymax=1,
enlargelimits=false,
clip = false,
xlabel={X},
ylabel={Y},
]
% some switch
\addplot [only marks,mark=*,mark size=2pt,line width=1pt,error bars/.cd,x dir=both,x fixed=0.3,error bar style={very thick}]
table[row sep=crcr]{% this is sample 1
0.5 0.12\\
1.5 0.23\\
3 0.35\\
5 0.54\\
7 0.74\\
9 0.93\\
};
% some switch
\addplot [only marks,mark=square,mark size=2pt,line width=1pt,error bars/.cd,x dir=both,x fixed=0.3,error bar style={very thick}]
table[row sep=crcr]{% this is sample 2
0.5 0.10\\
1.5 0.21\\
3 0.34\\
5 0.54\\
7 0.73\\
9 0.91\\
};
\end{axis}
\end{tikzpicture}