I have several issues that I can not resolve on my own.
- The label of the y-axis can not displayed on the top / above the arrow
- Then I can not put the 1/100% of the CDF on the y-axis (not even manually) – the "1" disappears.
- Furthermore the CDF has a long tail on the left side – but the graph suddenly stops.
- There is an "1" at the upper right corner and it does not disappear by using \pagestyle{empty}
% gnuplot is needed: https://sourceforge.net/projects/gnuplot/files/gnuplot/
% enter "PATH": c:\programme\gnuplot\bin
% pdfLaTeX: pdflatex -synctex=1 -interaction=nonstopmode -enable-write18 %.tex
The code
\documentclass{minimal}
\usepackage[language=autobib,backend=biber]{biblatex}
\pagestyle{empty} %There is a "1" in the upper right corner! - why?
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepgfplotslibrary{fillbetween}
\pgfdeclarelayer{pre main}
\pgfsetlayers{pre main,main}
\usepackage{scrlayer-scrpage}
\usepackage{pdflscape}
\usepackage[default]{sourcesanspro}
\def\cdf(#1)(#2)(#3){0.5*(1+(erf((#1-#2)/(#3*sqrt(2)))))}
\def\cdfx(#1)(#2)(#3){0.5*(1+(erf((#1-#2)/(#3*sqrt(2)))))}
\DeclareMathOperator{\CDF}{cdf}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=12cm,height=12cm,
ymin=0,ymax=1.1,
%xmin=-5.1, %Please turn on to see the "missing tail"!
xmax=6,
axis x line=center,
axis y line=left,
xlabel={$x$},
xtick=\empty,
xlabel style={right},
ytick=\empty,
ylabel={$F(x)$, $G(x)$},
ylabel style={above}, %Why is this not working? Label still "left"
smooth,
no markers,
clip=false
]
\addplot[smooth,black,name path=A, tick] gnuplot{\cdf(x)(0)(1)} node[right,pos=0.5, xshift=2ex]{$F$} node[right,pos=0.5, xshift=-12ex, yshift=0.75ex]{$G$};
\addplot[smooth,black,densely dashed,name path=B,tick]gnuplot{\cdfx(x+0.5)(0)(0,2)};
% Why is the tail on the left side of the graph missing?!
\pgfonlayer{pre main}
\tikzfillbetween[of=A and B, split, every even segment/.style={black}]{black!35};
\endpgfonlayer
\draw [black,densely dotted](0,100)--(1000,100)--(1000,0);
\node at (1050,100){$1$}; % \node at (-10,100){$1$} Does not work - "1" disapears!
\end{axis}
\end{tikzpicture}
\end{document}
Best Answer
I admit I cannot explain logically the
y label style
thing, but here you are:...with explications in the comments. Notice that I have removed all the packages that were not significant for the graph.