diff options
| author | mo khan <mo@mokhan.ca> | 2016-02-08 09:39:10 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2016-02-08 09:39:10 -0700 |
| commit | 88b5f75209b201530d4761532f214b12d99a0f99 (patch) | |
| tree | e48dbbd595955f1d79439ca589cc66f0ebbe7bb7 /report/template.tex | |
| parent | f66896985524217a4ab9fbac4cfb737750dc4b76 (diff) | |
plot data from csv file.
Diffstat (limited to 'report/template.tex')
| -rw-r--r-- | report/template.tex | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/report/template.tex b/report/template.tex index 64d9e0a..6da5910 100644 --- a/report/template.tex +++ b/report/template.tex @@ -1,9 +1,14 @@ \documentclass{article} \usepackage{amsmath} -\usepackage{graphicx} \usepackage{booktabs} -\usepackage{siunitx} +\usepackage{graphicx} \usepackage{pgfplotstable} +\usepackage{pgfplots} +\usepackage{siunitx} +\usepackage{tikz} % to generate the plot from csv + +\pgfplotsset{compat=newest} % place the legend below the plot +\usepgfplotslibrary{units} % display units nicely \sisetup{ round-mode = places, @@ -92,6 +97,7 @@ I'm referring to footnote \ref{myfootnote}. \caption{Dummy table} \end{table} +\newpage \begin{table}[h!] \begin{center} \caption{Autogenerated table from .csv file.} @@ -117,6 +123,31 @@ I'm referring to footnote \ref{myfootnote}. \end{table} \newpage +\begin{figure}[h!] + \begin{center} + \begin{tikzpicture} + \begin{axis}[ + width=\linewidth, + grid=major, + grid style={dashed,gray!30}, + xlabel=X Axis $U$, + ylabel=Y Axis $I$, + x unit=\si{\volt}, + y unit=\si{\ampere}, + legend style={at={(0.5,-0.2)},anchor=north}, + x tick label style={rotate=90,anchor=east} + ] + \addplot + % select columns by using actual column names in csv. + table[x=column 1,y=column 2, col sep=comma] {table.csv}; + \legend{Plot} + \end{axis} + \end{tikzpicture} + \caption{My first autogenerated plot.} + \end{center} +\end{figure} + +\newpage \begin{appendix} \listoffigures \listoftables |
