[Tex/LaTex] Changing font size of marker labels in pgfplots scatter plot

pgfplots

How can I change the font size of marker labels in a pgfplots scatter plot? I've tried label style={font=\small} in \pgfplotsset as well as adding scatter/@pre marker code/.code={font=\small}, to no avail.

MWE follows:

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{tikzpicture} 
\begin{axis}[
    xlabel=$a$,
    ylabel=$b$
]
\addplot[blue,mark=*,mark options={fill=blue},nodes near coords,only marks,
   point meta=explicit symbolic] table[meta=label] {
x y label
100 150 1
200 180 2
};
\end{axis}
\end{tikzpicture}
\end{document} 

Thanks!

Best Answer

You have to use every node near coord/.append style={font=\small} in the options of either axis or addplot or \pgfplotsset.

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    xlabel=$a$,
    ylabel=$b$,
    every node near coord/.append style={font=\small}
]
\addplot[blue,mark=*,mark options={fill=blue},nodes near coords,only marks,
   point meta=explicit symbolic] table[meta=label] {
x y label
100 150 1
200 180 2
};
\end{axis}
\end{tikzpicture}
\end{document} 

enter image description here