I am 2 weeks into using LaTex so pardon my noob-ness 🙂
I have some data in my physics lab that I need to graph, which I have in a tab-delimited text file called current-force.txt
. I graphed the data using pgfplots
. Here is the file contents:
current force
0.00 0.00
0.50 1.28E-03
1.00 2.75E-03
1.50 4.02E-03
2.00 5.40E-03
2.50 6.67E-03
3.00 8.04E-03
3.50 9.42E-03
4.00 1.07E-02
Here is my sample LaTex document:
\documentclass{article}
\usepackage{pgfplots}
\usepackage{siunitx}
\usepackage{float}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{amstext}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
title={Magnetic Force as a function of Applied Current},
xlabel=$I$ (\si{\A}),
ylabel=$\vec{F}_{\text{m}}$ (\si{\N}),
minor x tick num=1,
grid=both,
]
\addplot[red, mark=*] table[col sep=tab]{current-force.txt};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
I added the grid and the minor ticks on the x-axis, but I just don't know what would make this graph look nicer. One think I also find really ugly is the positioning for the axis multiplier for the y-axis, how would you guys approach this?
This is what the graph looks like after typesetting:
Best Answer
Here are some points I would change, other may disagree on them.
This is how I would do it.
and the code