% Standalone source for Figure 3 (Experiment 4: dump probability vs core depth).
% Compile: pdflatex fig3_exp4_core_depth.tex  ->  fig3_exp4_core_depth.pdf
\documentclass[border=4pt]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\begin{semilogyaxis}[
  width=15cm,
  height=5.6cm,
  xlabel={Unitary-core iterations},
  ylabel={Dump probability $\hat p$},
  xtick={0,1,2,3},
  xmin=-0.5, xmax=3.5,
  ymin=2e-5, ymax=5e-1,
  ymajorgrids=true,
  major grid style={gray!20},
  tick label style={font=\footnotesize},
  label style={font=\footnotesize},
  legend style={font=\scriptsize, draw=none, fill=none,
                at={(0.98,0.98)}, anchor=north east},
]
\addplot[domain=-0.5:3.5, samples=2, dashed, gray!70,
         line width=0.7pt] {0.190};
\addlegendentry{non-neutral control}
\addplot+[only marks, mark=*, mark size=2pt,
         color=blue!70!black,
         error bars/.cd,
         y dir=both, y explicit,
         error mark options={rotate=90, mark size=2pt},
         error bar style={blue!70!black, line width=0.6pt}]
table[row sep=\\, y error plus index=2, y error minus index=3]{
0  0.0075  0.00189  0.00151 \\
1  0.0004  0.00063  0.00024 \\
2  0.0018  0.00104  0.00066 \\
3  0.0002  0.00053  0.00015 \\
};
\addlegendentry{neutral, Wilson 95\% CI}
\end{semilogyaxis}
\end{tikzpicture}
\end{document}
