温馨提示:本文翻译自stackoverflow.com,查看原文请点击:其他 - Define pointtype using `word` command in gnuplot
gnuplot

其他 - 在gnuplot中使用`word`命令定义点类型

发布于 2020-03-28 23:29:52

我正在使用相同的线型(ls 1绘制多个数据文件但是,我想使用wrd_pt下面代码中包含的不同点类型来区分数据

结果显示在图中,其中GNUPLOT将变量中包含的值(wrd_pt而不是与每个数字关联的符号(正方形,三角形,...))绘制为点类型我正在使用,GNUPLOT 5.0并且没有任何方法可以更新它(我不是正在使用的计算机的sudoer)以将数组用于5.2版。

有谁知道我该如何解决?

[... initializing ...]
wrd_pt ="5 7 9 11 13 15"
[... some other piece of code ...]
set output "plot_1a.eps"
    plot for [i=1:words(fspo_one)] work_dir.word(fspo_one, i) u 1:5 w lp ls 1 pt word(wrd_pt, i) ps 1 notitle
unset output 

代码结果

查看更多

查看更多

提问者
many
被浏览
87
theozh 2020-01-31 18:05

为什么不使用绘图样式with labels也可以与gnuplot 5.0一起使用。

像这样:

码:

### point types as string from a string
reset session

wrd_pt = "5 7 9 11 13 15"

set xrange[0:10]
set style textbox opaque

set samples 10
plot for [i=1:words(wrd_pt)] '+' u 1:(i*$1**2) w l lw 2 notitle, \
     for [i=1:words(wrd_pt)] '+' u 1:(i*$1**2):(word(wrd_pt,i)) w labels boxed notitle

### end of code

结果:

在此处输入图片说明