1

Here's what I have right now:

enter image description here

Is there a way to change commas for dots and vice versa? This table was made using the answer from this question, so it's basically the same thing.

This isnt't an mwe, but here's the code for the graph:

\pgfplotstableread[row sep=\\,col sep=&]{
    interval & montecarlo & random\\
    1   & 3531.5  & 3.5 \\
    2   & 4088.5  & 1.08 \\
    3   & 4025.2  & 0.85 \\
    4   & 4049.7  & 1.056 \\
    5   & 4034.6  & 0.7\\
    6   & 4088.1  & 0.9 \\
    7   & 4043.5  & 0.3 \\
    8   & 4070.0  & 0.4\\
    9   & 4058.3  & 0.42\\
    10  & 4045.6  & 0.5\\
}\mydata

\begin{figure}
\centering
\begin{tikzpicture}
    \begin{axis}[ybar, symbolic x coords={1,2,3,4,5,6,7,8,9,10},
            xtick=data, nodes near coords,width=\textwidth, font=\footnotesize]
        \addplot table [x=interval, y=montecarlo]{\mydata};
    \end{axis}
\end{tikzpicture}
\caption{Tempos médios de deliberação do jogador Monte Carlo por partida} \label{montecarlotempos}
\end{figure}
Tuma
  • 333
  • I get an error when i edit the numbers: Could not parse input '3.531,5' as a floating point number, sorry. I guess they have to be written in american style, with dots for decimals. – Tuma Jun 29 '16 at 19:42

1 Answers1

2

In the axis options use the following:

/pgf/number format/1000 sep={.},/pgf/number format/use comma,

... 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.

See Jake answer.

\documentclass{article}
\usepackage{pgfplots}    
\begin{document}
\pgfplotstableread[row sep=\\,col sep=&]{
    interval & montecarlo & random\\
    1   & 3531.5  & 3.5 \\
    2   & 4088.5  & 1.08 \\
    3   & 4025.2  & 0.85 \\
    4   & 4049.7  & 1.056 \\
    5   & 4034.6  & 0.7\\
    6   & 4088.1  & 0.9 \\
    7   & 4043.5  & 0.3 \\
    8   & 4070.0  & 0.4\\
    9   & 4058.3  & 0.42\\
    10  & 4045.6  & 0.5\\
}\mydata

\begin{figure}
\centering
\begin{tikzpicture}
    \begin{axis}[ybar,/pgf/number format/1000 sep={.},/pgf/number format/use comma, symbolic x coords={1,2,3,4,5,6,7,8,9,10},
            xtick=data, nodes near coords,width=\textwidth, font=\footnotesize]
        \addplot table [x=interval, y=montecarlo]{\mydata};
    \end{axis}
\end{tikzpicture}
\caption{Tempos médios de deliberação do jogador Monte Carlo por partida} \label{montecarlotempos}
\end{figure}
\end{document}

enter image description here

G. Bay
  • 2,047