I use data1 = Table[]
in Mathematica 9 (M9) to generate a table of values. The thing is that when I read the data file, there's only one column! How can I plot this data file in LaTeX using pgfplots
? Here's a ME
\documentclass[border=1]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.5}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot table {TestTable.csv};
\end{axis}
\end{tikzpicture}
\end{document}
I also tried TestTable.txt
instead of .csv but without any success.
TestTable.csv is generated in M9 with the following code
Export[NotebookDirectory[] <> "TestTable.csv", data1]
where data1
is defined earlier in M9 is some data e.g. numerical integration or similar. A smaller version of data1 in textform (i.e. TestTable.txt) looks like this
1.1
2.3
3.0
4.1
5.3
6.2
7.3
8.4
9.6
10.3
\addplot table[x expr=\coordindex,y={<column name>}] {TestTable.csv};
Dimensions[data1]
={1000}
i.e. 1000 entries of pure numbers.column name
?