Graph Gnuplot平行坐标/轴打印关键点注释

Graph Gnuplot平行坐标/轴打印关键点注释,graph,gnuplot,visualization,Graph,Gnuplot,Visualization,我可以用Gnuplot 5.0绘制平行坐标图。例如: plot "ranking_top10.dat" using 4:5:6:7:8:2 with parallel lt 1 lc variable 将以不同颜色绘制5个轴和线。但是,我希望将键与这些行中的每一行相关联。例如,我想将一个键(字符串)与紫色线关联,并将其显示在图形上。如何做到这一点 这个问题很“老”,但仍然没有答案。也许答案还是有意思的。不幸的是,您没有提供完整的代码和数据来生成绘图 在你的情况下,我不知道一个简单而直接的方法自

我可以用Gnuplot 5.0绘制平行坐标图。例如:

plot "ranking_top10.dat" using 4:5:6:7:8:2 with parallel lt 1 lc variable
将以不同颜色绘制5个轴和线。但是,我希望将键与这些行中的每一行相关联。例如,我想将一个键(字符串)与紫色线关联,并将其显示在图形上。如何做到这一点

这个问题很“老”,但仍然没有答案。也许答案还是有意思的。不幸的是,您没有提供完整的代码和数据来生成绘图

在你的情况下,我不知道一个简单而直接的方法自动生成密钥。因此,解决方法是通过打印到虚拟表,以及虚拟打印
NaN
,将标题和颜色放入字符串中,以获得图例/键。 使用gnuplot 5.0.0和5.2.6进行测试

代码:

### parallel plot with proper keys
reset session

$Data <<EOD
1   1   "Set A"   5000    30000    51  0.35 0.23
2   2   "Set B"   8000    80000    20  0.5  -0.5
3   3   "Set C"   6000    20000    38  0.75 0.12
4   4   "Set D"   8000    50000    17  1.9  0.32
5   5   "Set E"   70000   110000   62  2.99 0.5
6   6   "Set F"   0       0        0   0    0
7   7   "Set G"   40000   130000   38  0.80 -0.05
8   8   "Set H"   3000    30000    19  0.55 0.1
9   6   "Set I"   11000   50000    22  1.75 0.12
EOD

unset border
set key out top right
set xrange[0.2:5.5]
set xtics 1 format "axis %g" scale 0,0
unset ytics

set for [i=1:5] paxis i tics format "%g" right offset 1.5,0  # ok for gnuplot 5.2.6
# set paxis 3 tics format "%g" right offset -1,0             # required (uncomment) for gnuplot 5.0.0

# create titles and colors
myTitles = myColors = ""
set table $Dummy
    plot $Data u (myTitles = myTitles.'"'.strcol(3).'" '), \
         '' u (myColors = myColors.sprintf("%g ",column(2))) w table
unset table

plot $Data u 4:5:6:7:8:2 w parallel lw 2 lc var not, \
     for [i=1:9] NaN w l lw 2 lc word(myColors,i) ti word(myTitles,i)
### end of code
####使用正确的键进行并行打印
重置会话
$Data