I have a data file with three columns: Xi, Yi, and Zi like this:
1 1 2
2 4 4
3 9 6
4 16 8
5 25 10
I need to plot Yi and Zi against Xi. So I use the following command:
plot 'speed.txt' using 1:2 with lines, 'speed.txt' using 1:3 with lines
and get this plot:
But the problem is that my data file is not in three columns most of the times. Basically I have two different data types which are stored in two columns. So, the same three-column file above will be like this in two column format: (the last column shows the car that has generated this data).
1 1 car1
1 2 car2
2 4 car1
2 4 car2
3 9 car1
3 6 car2
4 16 car1
4 8 car2
5 25 car1
5 10 car2
There is no special pattern in the data types, meaning car1 can generate 10 rows then car3 generates 2 rows, etc. and they are all mixed (something like a log file that events happen asynchronously).
Is there any way that I can get the same plot out of these data? For instance use the name of the car as a key to separate different data types.