I have a file (table) with a lot of columns. In the first column I have a time variable and the next three columns represent the vector components of position. Now I want to plot the vector magnitude in function of time. It is possible to do it with a simple command?
Another, related, problem. I have a file containing an angular velocity and a work, which are related. Now, instead of work I want to plot the efficiency. It is possible to divide the work column by a number? And if I have to use a different number for each work point and these different numbers are stored in a file, it is still possible?
For the first case I have the following code:
\documentclass{standalone}
\useoackage{pfgplots}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[title={}, xlabel={$x$}, ylabel={$z$},%
legend cell align=left]
\addplot[orange,thick]
table[x index=0,y index=1] {mydata.dat};
\legend{}
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
where mydata.dat
contains the following:
0 0 0 0
1 0.1 0 0
2 0.2 0.1 0
3 0.3 0.2 0.1
I want to plot the square root of the sum of the square of the last three columns (the columns represent vector components, so I want the magnitude) in function of time (the first column). Is it possible?
filecontents
so that the data points can be packaged in one file that can be cut and pasted to get those trying to help started.