[Tex/LaTex] Creating time series plot from csv data using pgfplots

pgfplots

I am trying to create a simple time series plot of daily price data using pgfplots. My data file is in CSV format and in the same folder as my working Tex file.

The data file has header titles in each of the top cells (Date and Price). All I need to do is plot the Closing Price on the y axis vs the time in the x axis. The time is in the form: 2010.542466, 2010.545205,… etc for daily price data. The code I have tried thus far in Latex looks like this:

\pgfplotstableread[col sep = comma]{coindesk.csv}

\begin{tikzpicture}
\begin{axis}[
xlabel=t,
ylabel=Close]
\addplot table[x=t,y=Close] {coindesk.csv};
\end{axis}
\end{tikzpicture}

However I get a series of error messages. Any help would be appreciated.

EDIT: The first three lines of my data look like:

t   Close 
2010.542466 0.09
2010.545205 0.08
2010.547945 0.07

Best Answer

There is no comma in your .csv file. If you add comma to your data file, the command \addplot table[col sep=comma] {coindesk.csv}; should work.