Skip to content

Instantly share code, notes, and snippets.

@bstellato
Created February 12, 2020 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bstellato/e92a1e461ef598b2e40e4cc4ba54e9f2 to your computer and use it in GitHub Desktop.
Save bstellato/e92a1e461ef598b2e40e4cc4ba54e9f2 to your computer and use it in GitHub Desktop.
Create PGFPlots lines from csv file
\begin{figure}
\begin{tikzpicture}
\begin{axis}
[
axis x line=bottom,
axis y line=left,
enlarge y limits=0.1, % Enlarge limits by 10%
% ymode=log, % If you want to be logarithmic
width=\textwidth,
height=0.33\textheight,
xlabel=$n$,
ylabel=Time,
% y unit=\si{\second}, % Measurement units using the siunitx
]
\addplot table [x=n, y=time_diff, col sep=comma] {./data/lot_sizing_data.csv};
% \addplot[mark=none, very thick] coordinates {(2,1000) (76, 1000)}; % Add straight line
\legend{Myline}
\end{axis}
\end{tikzpicture}
\caption{My Caption.}
\label{fig:my_label}
\end{figure}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment