\documentclass[a4paper]{article}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}
\addplot coordinates {
	(0,0) (1,0) 

	(1,1) (2,1)
}
	node[pos=0] {0} node[pos=0.5] {0.5} node[pos=1] {1};
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[empty line=none]
\addplot coordinates {
	(0,0) (1,0) 

	(1,1) (2,1)
}
	node[pos=0] {0} node[pos=0.5] {0.5} node[pos=1] {1};
\end{axis}
\end{tikzpicture}


\end{document}

