如何从gnuplot中的数据设置点类型?

如何从gnuplot中的数据设置点类型?,gnuplot,points,pt,Gnuplot,Points,Pt,如何从gnuplot中的数据设置点类型 gnuplot脚本: set terminal pngcairo size 640,480 set output "points.png" set style data points set auto x set autoscale x unset colorbox plot 'test.data' using 2:1 with points notitle 测试数据 32 35 8 34 34 6 36 28 1 34 32

如何从gnuplot中的数据设置点类型

gnuplot脚本:

set terminal pngcairo size 640,480
set output "points.png" 
set style data points 
set auto x 
set autoscale x 
unset colorbox 
plot 'test.data' using 2:1 with points notitle
测试数据

32  35  8
34  34  6
36  28  1
34  32  2
28  30  7
38  30  9
34  29  2
35  36  9
39  34  3
31  33  9
28  31  6
35  30  5
33  41  4
32  37  3
如何从3列中获取点类型

plot 'gnuplot.data' using 2:1 with points pt (:3) notitle // error 
抽象示例:

需要:


gnuplot版本4.6 patchlevel 4

没有基于列从数据文件中选择点类型的选项(相当于
linecolor变量
pointsize变量
箭头样式变量
)。基本上你有两个选择:

  • 迭代所有可能的点类型(如果该类型应为变量,则可使用
    stats
    提取),并仅为每个数字绘制与当前点类型匹配的点:

    stats 'test.data' using 3 nooutput
    unset key
    set style data points
    plot for [i=STATS_min:STATS_max] 'test.data' using 2:($3 == i ? $1 : 1/0) lt 1 pt i ps 2
    
  • 使用
    标签
    打印样式和一系列unicode点符号,从中使用第三列中的值作为索引进行选择。(例如,使用或查找合适的符号)

  • unset key
    set encoding utf8
    symbol(z) = "•✷+△♠□♣♥♦"[int(z):int(z)]
    plot 'test.data' using 2:1:(symbol($3)) with labels textcolor lt 1