I have a file with several blocks of data. Each block consists of several columns. Does anyone know how to plot each column combination within the same block with different colors either automatically or not?
Asked
Active
Viewed 1,390 times
1 Answers
0
You can use palette as line color. E.g., you can assign one of the columns (variables in it) to the color.
plot 'data.txt' u 1:2:3 w l lc palette
In example above 3 column will serve as input to defined palette.
If columns are note corresponding to desired colors you can do it manually, e.g.,
set palette defined ( 0 "green", 1 "blue", 2 "red", 3 "orange" )
plot 'data.txt' u 1:2:(0), 'data.txt' u 1:3:(1), 'data.txt' u 1:4:(2), 'data.txt' u 1:5:(3),...
In above example first line will be green, second blue, ...
Now, you can combine above examples with every command of gnuplot.
See also this
Jacek Herbrych
- 76
- 1
- 8