Skip to content

Instantly share code, notes, and snippets.

@jbfink
Created November 9, 2021 15:26
Show Gist options
  • Save jbfink/2f28ff9fe90ad85f6b6479f3389c9c41 to your computer and use it in GitHub Desktop.
Save jbfink/2f28ff9fe90ad85f6b6479f3389c9c41 to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage{pgfplots}
\begin{filecontents*}{data.csv}
a,b,c,d
1,4,5,1
2,3,1,5
3,5,6,1
4,1,4,9
5,3,4,7
\end{filecontents*}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
title={Sample graph generated from csv data},
ylabel=c,
xlabel=a]
\addplot table [x=a, y=c, col sep=comma] {data.csv};
\legend{values of c}
\end{axis}
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment