根据列中的值绘制新系列 [英] Plot new series based on value within column

查看:54
本文介绍了根据列中的值绘制新系列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们假设我们有一个像这样的数据:

Lets assume we have a data like :

1383.77224864627    1910.27446956287    13
2022.08962783969    1870.75968662608    13
2244.59435149955    2334.43843428841    13
3223.73010669775    2409.90834407782    15
708.364446053354    3199.82702811616    15
1190.6942303025     2634.33363259192    15
1749.15599203783    2716.76870380272    19
2227.80906774024    3119.99529267007    19

是否可以根据第三列中的值绘制序列?

Is it possible to plot series, based on values in the 3rd column ?

在此示例中,所需的结果将是在一个绘图上包含3个具有不同颜色的系列.

Desired result in this example would be to have 3 series with different colors on one plot.

我知道我可以使用创建新系列:

I'm aware that I can create new series with :

plot 'datafile' using col1:col2, '' using col1:col3

或通过在数据文件中的系列之间使用换行符,但这不是我想要的.

or by using new line between series in datafile but thats not I would like to do.

谢谢! 我正在使用gnuplot 5.0版

Thanks ! I'm using gnuplot version 5.0

推荐答案

基于

Building on my 2012 answer and my understanding of what you want, this should help:

set palette defined ( 13 "blue", 15 "red", 19 "green")
unset key
unset colorbox
plot [500:3500][1800:3500] "x" u 1:2:3 with points palette ps 3 pt 5

产生

还可以定义一个连续的调色板,并根据在该比例尺内的颜色值分配实际颜色.在实践中:

One could also define a continuous palette and let the actual colors be allocated depending upon their value within that scale. In practice:

set palette defined ( 0 "blue", 20 "green", 40 "red")
unset key
set colorbox                              # for demo purpose
plot [500:3500][1800:3500] "x" u 1:2:3 with points palette ps 3 pt 7

带来

.添加新系列后,颜色将发生变化.

for the given data set. Colors will change when new series is added.

这篇关于根据列中的值绘制新系列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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