Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
probml
GitHub Repository: probml/pyprobml
Path: blob/master/tikz/empirical_cdf_tikz.tex
1191 views
1
\documentclass[tikz,border=2pt]{standalone}
2
\usepackage[utf8]{inputenc}
3
\usepackage{tikz}
4
\usepackage{pgfplots}
5
\usetikzlibrary{positioning}
6
7
% \title{empirical_cdf_tikz}
8
% \author{Vishal Ghoniya}
9
% \date{July 2022}
10
11
\pgfplotsset{compat=1.18}
12
\begin{document}
13
14
% \maketitle
15
\begin{tikzpicture}[font={\small}]
16
\begin{axis}[axis line style={opacity=0},
17
axis lines=left, ytick={0.0,0.2,...,1.0},
18
ymax=1.1, ymin=-0.1,
19
xtick={0,1,...,4},
20
xmax=4.1,
21
axis background/.style={fill=gray!10},
22
extra y ticks={0.1,0.5,0.7},
23
extra y tick labels={{$U^{(1)}$},{$U^{(2)}$},{$U^{(3)}$}}]
24
\addplot+[const plot, no marks, thick, black] coordinates {(0,0) (1,0.3) (2,0.3) (2,0.8) (3,0.8) (3,0.8) (3,1) (4,1)};
25
\addplot+[const plot, no marks, dashed, thick, black] coordinates {(0,0.1) (1,0.1)};
26
\addplot+[const plot, no marks, dashed, thick, black] coordinates {(0,0.7) (2,0.7)};
27
\addplot+[const plot, no marks, dashed, thick, black] coordinates {(0,0.5) (2,0.5)};
28
\end{axis}
29
30
\end{tikzpicture}
31
\end{document}
32
33