plot - Intrafilular line plotting? -


Bit of a sticky position here. Actually, I have around 6 files of X, Y, Z Points (each has something like 200 points), all of which are related to each other. What I'm going to do is create a 3D (splot) of this data, which I can do in advance, only with the lines between these lines-- so file 1 in line with line 34 is 2 in line 2 And so on.

I can tell that I can not explain it to the best, so I will try and give some context. It is a simulation program which calculates the state of particles and then applies various forces to them. After every second of the simulation, it outputs a file, and so it will show the particles paths in 3D with lines.

To solve this, I have already considered giving my file to each particle, although every time I have to load each file (splot 'file.csv' etc.) then It will be slow - and the need for file IO will increase.

This is actually relatively easy Using the plotting style and the paste command with vectors, imagine that you have the following four files Are:

  # filename 1 name1 0 0 1 1 1  

and

  named file # 2 data 2 1 0 0 1 2 2  

and

  # file 3 named data 3 1 1 0 1 3 2  

and

  # filename 4 name 4 1 0 2 2 1 2  

particle will follow path 1 <0> 0 0 0 - & gt; 1 0 - 0 - & gt; 1 1 0 - & gt; 1 2 2 and particle 2 will follow the trajectory 1 1 1 - & gt; 1 2 2 - & gt; 1 3 2 - & gt; 2 1 2 .

With the vector the style is found in two points, for which you need 6 data points in 3D, which should be on the same file. It can be obtained by using the paste command:

  Paste data 1 data2> Data looks like 1-2  

file data1-2 :

  named file named # 1 data file # 2 Data 2 0 0 0 0 1 1 1 1 2 2  

But this is just to explain what's going on. This is done better with the files with the particles ( j = 0 first particle) and in the i duplication with files and j repetitive files.

  nfiles = 4 # number of files nparticles = 2 # number of [i = 1: 1] for the number of particles [j = 0: nparticles-1] "& lt; paste data ".i" data ". (I + 1) \ u 1: 2: 3: ($ 4- $ 1): ($ 5- $ 2): ($ 6 $ 3) each :: j :: jw vectors lc j + 1 t "particle For "[Data + 1], for [i = 2: nfiles-1] [J = 0: nparticles-1]" Paste Data "." Data ". (I + 1) \ u 1: 2: 3: ($ 4- $ 1): ($ 5- $ 2): ($ 6 $ 3) each :: J: JW vector LC J + 1 no  

Ta-Dah!

Enter image details here


Comments