
The picture produced by code blow, there are two problems I have.
(1) the number above point overlapped
(2) the precision of number is not right, eg. I want 0.913, not 0.91
For the first problem I tried the 'nodes near coords align', but no good result. Is there a way to solve this?
\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{filecontents}
\pagestyle{empty}
\begin{filecontents}{x.dat}
1,0.304313797
2,0.558012673
3,0.741302281
4,0.851281192
5,0.912940189
6,0.945961019
7,0.964838045
8,0.975736752
9,0.982694892
\end{filecontents}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line=bottom,
axis y line=left,
xlabel={Query Length},
ylabel={Percentage},
xmin=0,
ymin=0,
xmax=10,
ymax=1,
xtick={0,1,2,3,4,5,6,7,8,9},
ytick={0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9},
tick align=inside,
nodes near coords,
%nodes near coords align=horizontal,
]
\addplot table[x index=0, y index=1, col sep=comma,mark=none]
{x.dat};
\end{axis}
\end{tikzpicture}
\end{document}
