I extracted data from matlab figures, with the command "dlmwrite('heat.txt',[x',u],'delimiter', '\t')". It gives me a text file with 3 columns of numbers (the first is the abscisse x, and the other are 2 functions f(x) and g(x)). I wanted to plot it in Latex, so i've written this:
\begin{tikzpicture} \begin{axis} \addplot {heat.txt}; \end{axis} \end{tikzpicture} It's not working, I have the error : ! Package PGF Math Error: Unknown function `heat' (in 'heat.txt').. Then, I put file[skip first] in the line \addplot and it's working, I have the graph of (x,f(x)). I don't understand because my text file is only number. More important, I wanted to plot also (x,g(x)). So i've written:
\begin{tikzpicture} \begin{axis} \addplot file[skip first] table[x index=0,y index=2] {heat.txt}; \end{axis} \end{tikzpicture} And it does not work, the error is : ! Package pgfplots Error: sorry, plot file{t} could not be opened. I tried it without "file[skip first]", and it's the same error.
I really don't understand.