figure(1);

set(gcf, 'PaperUnits', 'centimeters');
xSize = 14; ySize = 20;
xLeft = (21 - xSize)/2; yTop = (30 - ySize)/2;
set(gcf,'PaperPosition', [xLeft yTop xSize ySize]);
set(gcf,'Position',[0 0 xSize*50 ySize*50]);

hold on;

t = title('Quantilssch\"atzung', 'interpreter', 'latex');
set(t, 'FontSize', 16);

xlabel('p');
ylabel('Q');

N = 100;

X = randn(N, 1);

hold on;

x = linspace(0.001, 1 - 0.001, 200);
q = icdf('Normal', x, 0, 1);

plot(x, q, 'b');

X_s = sort(X, 'ascend');
P(2*(1:N) - 1) = (1:N)/N;
Q(2*(1:N) - 1) = X_s;
P(2*(1:N)) = [(2:N)/N 1];
Q(2*(1:N)) = X_s;

plot(P, Q, 'g');
plot(0, X, 'r.');

axis([0 1 -3 3]);

l = legend('Theoretisches Quantil', ...
           ['Empirisches Quantil'], ...
           ['Stichprobe von $N = ', num2str(N), '$ IID Zufallszahlen aus $\mathcal{N}(0, 1)$']);
set(l, 'Interpreter', 'latex', 'FontSize', 15, 'Location', 'NorthWest');