TransWikia.com

pgf error maths

TeX - LaTeX Asked by juliana perez ordoñez on April 21, 2021

help me please:

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}
pgfplotsset{/pgf/number format/use comma,compat=newest}

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

begin{document}
    
maketitle  
    

begin{tikzpicture}
    begin{axis}[xlabel=p1, ylabel=p1t, tick style={draw=none}]
        
    addplot[color=black] file{dicloro.txt};
        
    end{axis}
end{tikzpicture}   

end{document}

One Answer

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.

Answered by Torbjørn T. on April 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP