绘制第一列和最后一列(可变数)gnuplot [英] plot first and last columns (variable number) gnuplot

查看:59
本文介绍了绘制第一列和最后一列(可变数)gnuplot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能非常简单,但是我找不到对此的具体答案:如何在列号可变的几个文件中绘制第一列与最后一列以及倒数第二列?是否有

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 :(

谢谢!

推荐答案

gnuplot中的自动序列显示了一种可能性.但这在Windows中不起作用.在特殊情况下,所有列仅包含数字值(没有时间或字符串),那么您可以将gnuplot第5版使用以下内容:

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

请注意,您在评论中发布的数据在最后一列中包含奇怪的字符(U + 200C零宽度非JOINER和U + 200B零宽度空格).我不知道您是否在原始数据文件中也有它们,但这会破坏您的数据.

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.

这篇关于绘制第一列和最后一列(可变数)gnuplot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆