pgf error maths

I don't understand why pgf show me this error, for all my dates:

Package PGF Math Error: Could not parse input '14.099117,3.068e+6,' as a floating point number, sorry. The unreadable part was near ',3.068e+6,'.. \addplot[color=black] file{dicloro.txt};


this is my archive:

\documentclass[]{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{pgfplots, pgfplotstable, pgf}
\usepackage{xcolor}
\usepgfplotslibrary{fillbetween}
\usepgfplotslibrary{colorbrewer}
\usepgfplotslibrary{patchplots}
\selectcolormodel{cmyk}
\usepackage{mathtools,amsmath,amsthm}
\usetikzlibrary{spy}
\usetikzlibrary{plotmarks}
\pgfplotsset{compat=1.9}

%opening
\title{PGF plots}
\author{Juliana Pérez}

\begin{document}

\maketitle

\begin{tikzpicture}
\begin{axis}[xlabel=p1, ylabel=p1t, tick style={draw=none}]

\end{axis}
\end{tikzpicture}

\end{document}


I think pgfplots assumes that columns in data files are separated by a space by default, and you seem to have comma separated columns. Try using

\addplot[color=black] table[col sep=comma]{dicloro.txt};


instead of \addplot[color=black] file{dicloro.txt};.

This will by default use the first column for the x-values, and the second column for the y-values.

• does not work, the same error appears Feb 9, 2021 at 22:10
• @julianaperezordoñez Can you show a few lines of what your data file looks like? Edit your question to include it. Feb 9, 2021 at 22:12
• look at this: prnt.sc/yw5e43 Feb 9, 2021 at 22:15
• @julianaperezordoñez That is a different error. In the screenshot the error is that pgfplots cannot find the datafile, dicloro.txt. The error you mention in the question is that pgfplots tries to interpret 14.099117,3.068e+6, as a single number. Is dicloro.txt in the same folder as your .txt file? Feb 9, 2021 at 22:21
• @Juliperezor, instead of/additionally to writing "thank you" in the comment, please consider upvoting (by clicking on the arrows next to the score) and/or marking it as the accepted answer (by clicking on the checkmark ✓). Jul 11, 2021 at 6:12