\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}
\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=$h_x/J$,
    xmin=0,
    xmax=3.5,
    ymin=0,
    ymode=log,
    xticklabel style = {/pgf/number format/fixed, /pgf/number format/zerofill, /pgf/number format/precision=1},
    xtick = {0.0, 0.3, 0.6, ..., 2.8},
    tickpos=left,
    ytick align=inside,
    xtick align=outside,
    ylabel style = {yshift=-0.1cm}
]


\nextgroupplot[ylabel=Sum of trunc. errors, ytick={1e-10,1e-8,1e-6}, legend style = {anchor = south east,at={(axis description cs: 1, 0)}},
title = {(a)}, title style = {at = {(axis description cs:0.05,0.75)}}]
\addplot[draw = viryellowdark, mark=*, mark options = {fill=white}] table [x=<h>, y=<Sum>, col sep=tab] {DMRG_Data/TruncationError_h_L050.dat};
\addplot[draw = virmiddle, mark=square*, dotted, mark options={fill=white, solid}] table [x=<h>, y=<Sum>, col sep=tab] {DMRG_Data/TruncationError_h_L100.dat};
\addplot[draw = virmiddle, mark=diamond*, mark size=3pt, solid, mark options={fill=white, solid}] table [x=<h>, y=<Sum>, col sep=tab] {DMRG_Data/TruncationError_h_L150.dat};
\addplot[draw = virdark, mark=*, dashed, mark options={fill= white, solid}] table [x=<h>, y=<Sum>, col sep=tab] {DMRG_Data/TruncationError_h_L200.dat};
\legend{\textcolor{viryellowdark}{$L=50$}, \textcolor{virmiddle}{$L=100$}, \textcolor{virmiddle}{$L=150$},  \textcolor{virdark}{$L=200$}};

\nextgroupplot[legend style = {anchor = south east,at={(axis description cs: 1, 0)}}, ylabel=Max truncation error, ytick={1e-14,1e-12,1e-10,1e-8,1e-6},
title = {(b)}, title style = {at = {(axis description cs:0.05,0.75)}}, xlabel style = {at = {(axis description cs: 0.96,0.13)}}]
\addplot[draw = viryellowdark, mark=*, mark options = {fill=white}] table [x=<h>, y=<Max>, col sep=tab] {DMRG_Data/TruncationError_h_L050.dat};
\addplot[draw = virmiddle, mark=square*, dotted, mark options={fill=white, solid}] table [x=<h>, y=<Max>, col sep=tab] {DMRG_Data/TruncationError_h_L100.dat};
\addplot[draw = virmiddle, mark=diamond*, mark size=3pt, solid, mark options={fill=white, solid}] table [x=<h>, y=<Max>, col sep=tab] {DMRG_Data/TruncationError_h_L150.dat};
\addplot[draw = virdark, mark=*, dashed, mark options={fill= white, solid}] table [x=<h>, y=<Max>, col sep=tab] {DMRG_Data/TruncationError_h_L200.dat};\legend{\textcolor{viryellowdark}{$L=50$}, \textcolor{virmiddle}{$L=100$}, \textcolor{virmiddle}{$L=150$},  \textcolor{virdark}{$L=200$}};
\end{groupplot}
\end{tikzpicture}

\end{document}