\documentclass{standalone}
\input{palette}
\usepackage{pgfplots}
\pgfplotsset{compat=default}
% With this compatability setting, pgfplots runs in backwards compatability mode using pgfplots version pre-1.3. It's safe to use a more current version, but axis and tick labels may move and need to be repositioned.

%\usepackage{txfonts}
%\usepackage[mathscr]{euscript}
% The above font packages were used to generate figures for the article, but are here commented out to ensure better compability.

\usetikzlibrary{pgfplots.groupplots}

\newcommand{\mytick}[2]{\draw[thick,#2] (#1, 0.01) -- (#1, -0.15);}

\begin{document}
\begin{tikzpicture}
\def\xclas{1.58}
\def\xclasT{1.58*2.1/1.604}
\begin{groupplot}[
    group style={
        group name=my plots,
        group size=1 by 2,
        xlabels at=edge bottom,
        xticklabels at=edge bottom,
        vertical sep=0pt
    },
    width=0.8\textwidth,
    height=0.4\textwidth,
    xlabel=$B$ (T),
    xmin=0,
    xmax=3.0,
    ymin=0,
    xticklabel style = {/pgf/number format/fixed, /pgf/number format/zerofill, /pgf/number format/precision=1},
    xtick = {0.0, 0.5, 1.0, ..., 2.5},
    yticklabel style = {/pgf/number format/fixed, /pgf/number format/zerofill, /pgf/number format/precision=1},
    tickpos=left,
    ytick align=inside,
    xtick align=outside,
    ylabel style = {yshift=-0.3cm} % <--- this is yshift which makes no sense!
]



\nextgroupplot[legend columns=2,legend style = {anchor = south east,at={(axis description cs: 1, 0)},
/tikz/column 2/.style={
	column sep=5pt,
}}, 
legend cell align={left}, ylabel=$C_1$, ytick={-0.4, -0.2, 0.0, 0.2, ...,0.3},
ymin=-0.56,
ymax=0.4,
title = {(a)}, title style = {at = {(axis description cs:0.05,0.75)}}, xlabel style = {at = {(axis description cs: 0.96,0.13)}}]
\addplot[restrict x to domain=0:2.2][draw = virmiddle, color = virdark, mark=diamond*, dotted, mark options={solid}] table [x=<h>, y=<C1prime>, col sep=space, x expr = \thisrowno{1}*2.1/1.604]{EntanglementData/TwoTangle_h.dat};
\addplot[virmiddle, mark=o, dashed, mark options={solid}] table [x=<Field(T)>, y=<C1prime>, col sep=space] {ExpTwoTangle/EXP_TwoTangle.dat};

\addplot[restrict x to domain=0:2.2][draw = virmiddle, color = virdark, mark=diamond, dashdotted, mark options={solid}] table [x=<h>, y=<C1bis>, col sep=space, x expr = \thisrowno{1}*2.1/1.604]{EntanglementData/TwoTangle_h.dat};
\addplot[virmiddle, mark=*, solid, mark options={solid}] table [x=<Field(T)>, y=<C1bis>, col sep=space] {ExpTwoTangle/EXP_TwoTangle.dat};

\addplot +[mark=none,black] coordinates {(0, 0) (3, 0)};
\addplot +[mark=none,black,solid] coordinates {(\xclasT, -0.5) (\xclasT, 0.5)};
\legend{\textcolor{virdark}{DMRG $C_1'$}, \textcolor{virmiddle}{Exp. $C_1'$}, \textcolor{virdark}{DMRG $C_1''$}, \textcolor{virmiddle}{Exp. $C_1''$}};


\nextgroupplot[ylabel=$\tau_2$, ytick = {0.0, 0.1, 0.2, ..., 0.6},legend style = {anchor = north east,at={(axis description cs: 1, 1)}},
ymax=0.45,
legend cell align={left},
title = {(b)}, title style = {at = {(axis description cs:0.05,0.75)}}, xlabel style = {at = {(axis description cs: 0.96,0.13)}}]
\addplot[virmiddle, mark=*, dashed, mark options={solid}] table [x=<Field(T)>, y=<Tau2>, col sep=space] {ExpTwoTangle/EXP_TwoTangle.dat};
\addplot[restrict x to domain=0:2.2][draw = virmiddle, color = virdark, mark=diamond*, solid, mark options={solid}] table [x=<h>, y=<tau2>, col sep=space, x expr = \thisrowno{1}*2.1/1.604, y expr = \thisrowno{2}]{EntanglementData/TwoTangle_h.dat};
\legend{\textcolor{virmiddle}{Exp. $\tau_2$}, \textcolor{virdark}{DMRG $\tau_2$}};

\end{groupplot}
\end{tikzpicture}

\end{document}


