number format in pgfplots axis

How can I change the type of the decimal/thousand separator from the american one to the european one? More precisely, I want:

• "1000" to be written as is, instead of "1,000"
-

The number formatting is changed using the /pgf/number format keys, which are described starting on page 546 of the pgfmanual. In your case, you would want to set /pgf/number format/use comma to set the comma as the decimal separator, and /pgf/number format/1000 sep={} to suppress separators for the groups of thousands.

When setting several subkeys, you can save yourself a bit of typing by first changing to the main key using /pgf/number format/.cd, and then setting the number formats.

Since I assume you want the number format to be consistent all through your plot, you should set the options for the whole axis.

Here's an example:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
/pgf/number format/.cd,
use comma,
1000 sep={}]
\end{axis}
\end{tikzpicture}

\end{document}


-
Do you know if it is possible to have pgfplots(and TikZ) to format numbers like \num{} from the siunitx package (ftp.dante.de/tex-archive/help/Catalogue/entries/siunitx.html). -Like my numbers in the rest of the document. –  Hans-Peter E. Kristiansen Dec 10 '11 at 17:50
@Hans-PeterE.Kristiansen: Yes, you can set xticklabel=\num[round-mode=places,round-precision=1]{\tick} (or similar). –  Jake Dec 11 '11 at 1:24
I think a new option like american number format or european number format could be useful here (this is a comment for @ChristianFeuersänger). Otherwise, if one uses siunitx, the number format should be gathered from the options set in that package. –  Luigi Dec 17 '12 at 16:55

Edit: As per Jake's comments: using set decimal separator={,} instead of use comma introduces an unwanted thin space after the comma. Interestingly, if you use set decimal separator={.}, this doesn't happen. So, better to use use comma instead as per Jake's solution.

Use set thousands separator={} and set decimal separator={,} which yields:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
y tick label style={/pgf/number format/.cd,%
scaled y ticks = false,
set thousands separator={},
fixed},
x tick label style={/pgf/number format/.cd,%
scaled x ticks = false,
set decimal separator={,},
fixed}%
]
(0.1,1000)
(0.2,1100)
(0.3,1200)
};
\end{axis}
\end{tikzpicture}
\end{document}

-
Use set decimal separator={{,}} to avoid this behavior. –  Patrick Bergner Dec 23 '12 at 18:45
@PatrickBergner I have tried this and it is not improving the situation. Any idea? –  Magpie Mar 10 '13 at 14:34
@Magpie: Without more details it is difficult to help. I'd suggest posting a new question. You should refer to this question and show exactly how this did not improve the situation. –  Peter Grill Mar 10 '13 at 20:49
@PeterGrill it's ok I fixed it. See answer below. Thanks! –  Magpie Mar 10 '13 at 21:27
@Magpie: In some countries (like Germany) a comma is used as the decimal separator and a period as the thousands separator. It's just a convention. –  Jake Mar 10 '13 at 23:43