Here is the code for a cumulative distribution function of a discrete random variable.
\begin{axis}[
clip=false,
jump mark left,
ymin=0,ymax=1,
xmin=0, xmax=6,
every axis plot/.style={very thick},
discontinuous,
table/create on use/cumulative distribution/.style={
create col/expr={\pgfmathaccuma + \thisrow{f(x)}}
}
]
\addplot [red] table [y=cumulative distribution]{
x f(x)
0 0
1 1/15
2 2/15
3 1/5
4 4/15
5 1/3
6 0
};
\end{axis}
The image of the code is like this.
However, I think the dot of the CDF
should be above as shown below.
Can anyone help with the code?
Thank you guys for the advice. It is actually my first time using StackExchange, so might not follow some rules.
The code is from @Jake: tex.stackexchange.com/a/198397/38080. Thank Jake for sharing that.

discontinuoskeyword is not in the standardpgfplots--- some additional package is needed. Posting a complete example will help us help you, without having to chasing packages around. – Rmano Jan 15 '21 at 08:26discontinouscode seems to come from @Jake: https://tex.stackexchange.com/a/198397/38080 – Rmano Jan 15 '21 at 08:52