问题
It might be very simple, but I cannot find the specific answer to this: how can I plot the first vs the last and the second to last columns in several files whose column number is variable? is there something like
plot "mydata.txt" using 1:-1?
I've already tried to use tail, but I don´t know hot to specifically use it, and couldn´t make this answer Count columns in csv in gnuplot work neither :(
Thanks!
回答1:
An answer to Automatic series in gnuplot shows one possibility. But that doesn't work in Windows. In your special case, that all columns contain only numerical values (no time or strings), then you can use with gnuplot Version 5 the following:
stats 'mydata.txt' matrix nooutput
plot "mydata.txt" using 1:STATS_size_x
Beware, that the data you posted in a comment contains strange characters (U+200C ZERO WIDTH NON-JOINER and U+200B ZERO WIDTH SPACE) in the last column. I don't know if you also have them in your original data file, but that breaks your data.
来源:https://stackoverflow.com/questions/32846346/plot-first-and-last-columns-variable-number-gnuplot