# Symbolic coordinates with commas

How can I use symbolic x coords={} with commas as decimal separators?

For example, I need to use symbolic x coords={0,1.5,1.3}, which gives full stops as decimal separators. Using use comma does not have an effect (logically, so I have nothing against that).

Minimal working example:

\documentclass[border=2pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
symbolic x coords={0,1.5,1.3},
xtick=data,
/pgf/number format/.cd,
use comma,
]
(0, 1)
(1.5, 2)
(1.3, 1)
};
\end{axis}
\end{tikzpicture}
\end{document}

-
I don't seem to have the necessary version installed, so I can't check it, but my guess would be that you just have to enclose the numbers in braces, i.e. symbolic x coords={0,{1,5},{1,3}} –  celtschk Apr 15 '12 at 12:08
The use comma option works fine for me without symbolic x coords. –  Thorsten Donig Apr 15 '12 at 12:09
BTW, I just notice that you have a comma after use comma despite no options following. Maybe it works if you remove that? –  celtschk Apr 15 '12 at 12:12
@celtschk I am aware of that, but then I would have to enclose portions of the data as well, which is tedious and I can not reasonably automate it. The comma after use comma does not have an effect. –  Harold Cavendish Apr 15 '12 at 12:17
@ThorstenDonig I know, but the symbolic coordinates are necessary (the x axis corresponds to time and another quantity while the time is raising but the other quantity is changing in both directions). –  Harold Cavendish Apr 15 '12 at 12:17

As it is, PGFplots thinks that the symbolic coordinates are text strings, so it doesn't apply the number formatting options. To fix this, you can set xticklabel=\pgfmathprintnumber{\tick}, which feeds the strings through the number parser and formats them accordingly:

\documentclass[border=2pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
symbolic x coords={0,1.5,1.3},
xtick=data,
/pgf/number format/.cd,
use comma,
xticklabel=\pgfmathprintnumber{\tick}
]