gnuplot:即使在丢失/无效之间也连接点 [英] gnuplot: Connect points even when missing/invalid are inbetween

查看:80
本文介绍了gnuplot:即使在丢失/无效之间也连接点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据文件,其中包含来自不同设备的数据行.

I have a data file with interleaving data rows from different devices.

现在,我想从一个设备with linepoints绘制数据,并使用它仅过滤感兴趣的设备:

Now, I'd like to plot data from one devices with linepoints and use this to filter only the device of interest:

plot 'datafile' using (<someCondition> ? $1 : 1/0):2

现在,gnuplot无法连接这些点,因为它们之间总是存在一些无效数据.

Now, gnuplot does not connect the points because there is always some invalid data inbetween.

是否可以使gnuplot连接我的点?

顺便说一句:这是Windows计算机,因此无法使用外部sed/awk/whatever命令.

By the way: This is a Windows machine, so an external sed/awk/whatever command is no option.

推荐答案

自gnuplot版本5.0.6起,您可以使用set datafile missing NaN将无效点视为丢失的点,而绘制with lineswith linespoints时将忽略这些无效点指向并连接其他人

Since gnuplot version 5.0.6 you can use set datafile missing NaN to have invalid points treated as missing ones, and drawing with lines or with linespoints simply ignores those points and connects the others

$data <<EOD
12
27
0
23
42
EOD

set multiplot layout 1,2

set title '0.0 invalid'
plot $data using 0:($1 == 0.0 ? 1/0 : $1) with linespoints pt 7 notitle

set title '0.0 invalid but treated as missing'
set datafile missing NaN
replot
unset multiplot

5.0.6的输出:

这篇关于gnuplot:即使在丢失/无效之间也连接点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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