plot first and last columns (variable number) gnuplot

倾然丶 夕夏残阳落幕 提交于 2021-02-05 07:11:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!