gnuplot条件绘图:如果col C == x,则打印col A:col B [英] gnuplot conditional plotting: plot col A:col B if col C == x

查看:94
本文介绍了gnuplot条件绘图:如果col C == x,则打印col A:col B的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该如何在gnuplot中做到这一点?

How can I do this in gnuplot:

plot "test.csv" using 1:2 if value_in_column_3 == 80.0

仅应选择第3列== 80.0的那些行,并忽略所有其他行(不应为其他行绘制0,只需忽略它们)

It should only select those rows where column 3 == 80.0 and ignore all other rows (It should not plot a 0 for the other rows, simply ignore them)

谢谢.

推荐答案

考虑以下数据集(1.dat),

1 0.8 0
2 0.6 0
3 0.9 1
4 1.1 0
5 0.7 0
6 0.6 1

仅在第三列等于零时才想绘制前两列.然后您可以尝试以下方法:

where we want to plot the first two columns only when the third one equals zero. Then you can try this:

plot '1.dat' using 1:($3==0?$2:1/0)

(在Gnuplot邮件列表上记入 markjoe .)

(Credit to markjoe on Gnuplot mailing-list.)

这篇关于gnuplot条件绘图:如果col C == x,则打印col A:col B的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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