Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a file containing a lots of data: time, position (3 coordinates), velocity (3 coordinates) and energy. I want to pick only the coordinates at t=50 (50th column of the table) and calculate the magnitude of position vector. Something like this:

   coordinate[line50]{0.1, \sqrt(\thisline{1}^2+\thisline{2}^2+\thisline{3}^3)};

   coordinate[line50]{0.01, \sqrt(\thisline{1}^2+\thisline{2}^2+\thisline{3}^3)};

   coordinate[line50]{0.001, \sqrt(\thisline{1}^2+\thisline{2}^2+\thisline{3}^3)};

To be more specific is like I have to use the file keyword with the coordinate keyword for mote than one file (because the x coordinate of my point is not stored on the file). As I said I have to do some algebra on data I get from the file...

Is this possible with pgfplots? How?

EDIT: I will explain better my problem.

I'm working on a numerical simulation of Magnus effect (ballistic with air drag and lift). I have a file that contains a table containing time, position (3 coordinates), velocity (3 coordinates) and energy. This file is for one simulation with a fixed time-step. I have to plot the position at 50s in function to the time-step. So I have many file with the same simulation but with different time-steps. I have to get position (magnitude of position) at 50s from each file and plot it in function of time step (time step is not contained on the file)... I hope it's more clear now.

share|improve this question

closed as unclear what you're asking by Joseph Wright Aug 2 '14 at 22:04

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Please add a minimal working example (MWE) that illustrates your problem. You can use the filecontents package for the dummy data it doesn't have to be 50 columns anyway. Also you can search for examples on this site. It's really not so straightforward to replicate your problem from scratch. – percusse Oct 18 '12 at 19:20
I don't have a MWE because I don't even know is what I want is possible... – R. M. Oct 18 '12 at 19:40
But on the other hand without it the question id doubly difficult because we don't know what you want without the MWE. Descriptions are rarely sufficient. You can just put a few lines of data and comment a TeX file that has stuff like I want magnitude of this to appear here etc. – percusse Oct 18 '12 at 19:43
@percusse I improved the question. Maybe it is better. If not, I will try to provide also some data and a "M(W)E"... – R. M. Oct 18 '12 at 19:44
@percusse I will try to do a M(W)E. – R. M. Oct 19 '12 at 7:30

Browse other questions tagged or ask your own question.