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

Define pointtype using `word` command in gnuplot

我正在使用相同的线型 (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 

为什么不使用绘图样式 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***2) w l lw 2 notitle, \
     for [i=1:words(wrd_pt)] '+' u 1:(i***2):(word(wrd_pt,i)) w labels boxed notitle

### end of code

结果: