I have a large number of data that I want to plot using gnuplot. In the files text column, as many columns I wanted to use Gnulplot to plot all the columns in any file, without identifying the number of columns to be plotted or the number of total columns in the file Without identifying, since the total number of columns varies, the files I have to have are such a way that I can use it gnuplot?
You can go about it differently, some more and some less elegant.
Make the following file as There are 3 columns in it, but you want to write a normal script without any particular number of assumptions. The way I had to go about this, send it to Say you ' T Then the Gnulplet will complain about the non-existent data but still the column 1 to 3 will be the same. data as an example:
1 2 3 2 5 5 5 3 1 3 4 5 2 5 5 5 6 4 2
awk
to get the number of columns in your file in the gnuplot script by system ()
call: N = system ("awk 'NR == 1 {print NF}' 'data)
wants to use the system ()
and know that the number of columns will always be less than a certain maximum, for example 10:
for the plot [I = 1:10] "data" u 0: iwl title "column" .i
No comments:
Post a Comment