I want to plot a function that looks something like this
Here is how I am currently doing it
\begin{tikzpicture}
\begin{axis}
\addplot[domain=0:1]{0.27};
\addplot[domain=1:2]{0.62};
\addplot[domain=2:3]{0.82};
\addplot[domain=3:4]{1};
\addplot[only marks,fill=white]coordinates{(0,0.27)(1,0.62)(2,0.82)(3,1)};
\addplot[only marks]coordinates{(0,0.05)(1,0.27)(2,0.62)(3,0.82)(4,1)};
\end{axis}
\end{tikzpicture}
However, I would like to plot each segment using its endpoints, like
\begin{tikzpicture}
\begin{axis}
\addplot[mark=*]coordinates{(0,0)};
\addplot[domain=0:1,mark=*]coordinates{(0,0.27)(1,0.27)};
\addplot[domain=1:2,mark=*]coordinates{(1,0.62)(2,0.62)};
\addplot[domain=2:3,mark=*]coordinates{(2,0.82)(3,0.82)};
\addplot[domain=3:4,mark=*]coordinates{(3,1)(4,1)};
\end{axis}
\end{tikzpicture}
Which looks like
How do you set the markers individually so that the bottom plot looks like the top plot?


