\documentclass[a4paper]{article}

\usepackage{pgfplots}

\usepgfplotslibrary{statistics}

\begin{document}
\def\annot{
		[above]
		node 
			at (boxplot whisker cs:
					\pgfkeysvalueof{/pgfplots/boxplot/lower whisker},1)
		 {Lower}
		%
		node 
			at (boxplot whisker cs:
					\pgfkeysvalueof{/pgfplots/boxplot/upper whisker},1)
		 {Upper}
		%
		node 
			at (boxplot box cs:
					\pgfkeysvalueof{/pgfplots/boxplot/lower quartile},1)
		 {Lower Q}
		%
		node 
			at (boxplot box cs:
					\pgfkeysvalueof{/pgfplots/boxplot/upper quartile},1)
		 {Upper Q}
}

	\begin{tikzpicture}
	%\tracingmacros=2 \tracingcommands=2
		\begin{axis}[
		]
		\addplot+[
			boxplot prepared={
				lower whisker=5,
				lower quartile=7,
				median=8.5,
				upper quartile=9.5,
				upper whisker=10,
				draw position=\thisrow{pos},
			},
		]
		table[row sep=\\,y=v] {
	v pos\\
	1 4\\
	3 4\\
		}
		\annot
		;

		\end{axis}
	\end{tikzpicture}

	\begin{tikzpicture}
	%\tracingmacros=2 \tracingcommands=2
		\begin{axis}[
		]
		\addplot+[
			boxplot={
				draw position=\thisrow{pos},
			},
		]
		table[row sep=\\,y=v] {
	v pos\\
	1 4\\
	3 4\\
	5 4\\
	6 4\\
	7 4\\
	7 4\\
	7 4\\
	8 4\\
	8 4\\
	8 4\\
	9 4\\
	9 4\\
	9 4\\
	9 4\\
	9 4\\
	10 4\\
	10 4\\
	10 4\\
	10 4\\
	10 4\\
		}
		\annot
		;

		\end{axis}
	\end{tikzpicture}

\end{document}

