当我运行这些说明时:
array Array001=[97,45,15,42,22,31]
array Array002=[53,22,76,76,53,12]
array Array003=[12,14,43,44,98,75]
set datafile separator comma
set style data spiderplot
set term windows
unset xtics; unset ytics; unset x2tics; unset y2tics
set spiderplot
set grid spider back
set grid xtics back
set grid noytics
set xrange [-1.2:1.2]
set yrange [-1.2:1.2]
set border 0
set colorsequence classic
set title "{/Tahoma=20 Adventure Time}" textcolor rgb "0xE25822" rotate by 0
set key inside top right opaque fc rgb "0xFFFFFF"
set style spiderplot fill pattern 5 border pt 6 ps 2
set for [a=1:7] paxis a range [11.0000:99.0000]
set for [b=1:1] paxis b tics
plot for [d=1:|Array001|] Array001 using (Array001[d]) lc 1,keyentry with spiderplot lc 1 title "Orc",newspiderplot,for [e=1:|Array002|] Array002 using (Array002[e]) lc 2,keyentry with spiderplot lc 2 title "Wizard",newspiderplot, for [f=1:|Array003|] Array003 using (Array003[f]) lc 3,keyentry with spiderplot lc 3 title "Archer"
对于第一个数据点阵列,图表本身的模式是“空白”,但关键是显示“正确”的模式。其他数组在图表与键上显示相同的模式。
为什么图表上第一个数组的模式与键上的模式不同?
罗伯托
据我所知,
spiderplot
绘图风格是在gnuplot 5.4中引入的,从你的命令set key opaque fc rgb "#FFFFFF"
,我假设你正在使用gnuplot>=5.4.5。
到目前为止,我还没有使用过绘图风格
spiderplot
,因为我使用旧版本“手动”创建了spiderplots(<5.4) of gnuplot. Another question and solution about spider plots: 如何在gnuplot中制作蜘蛛图?
我猜你的问题可能是蜘蛛图绘图风格中的错误。它似乎总是以
fs pattern 0
(空填充)开头,并且可能会与键条目混淆。
我还没有测试过这在 gnuplot 5.5 中是否会有所不同。
作为解决方法,您可以显式指定颜色和图案填充,例如
lc 1 fs pattern 1
。
事实上,fs pattern 1
让读取数字有点困难。不幸的是,gnuplot 只有有限数量的填充模式。
脚本:(使用 gnuplot>=5.4.5)
### spiderplot fill bug(?)
reset session
set term wxt size 640,640 # or term windows
array Array001=[97,45,15,42,22,31]
array Array002=[53,22,76,76,53,12]
array Array003=[12,14,43,44,98,75]
set datafile separator comma
set style data spiderplot
unset xtics; unset ytics; unset x2tics; unset y2tics
set spiderplot
set grid spider back
set grid xtics back
set grid noytics
set xrange [-1.2:1.2]
set yrange [-1.2:1.2]
set border 0
set colorsequence classic
set title "{/Tahoma=20 Adventure Time}" textcolor rgb "0xE25822" rotate by 0
set key inside top right opaque fc rgb "0xFFFFFF"
set style spiderplot fill pattern 5 border pt 6 ps 2
set for [a=1:7] paxis a range [11.0000:99.0000]
set for [b=1:1] paxis b tics
plot for [d=1:|Array001|] Array001 u (Array001[d]) lc 1 fs pattern 1, \
keyentry w spiderplot lc 1 fs pattern 1 ti "Orc", \
newspiderplot, \
for [e=1:|Array002|] Array002 u (Array002[e]) lc 2 fs pattern 4, \
keyentry w spiderplot lc 2 fs pattern 4 ti "Wizard", \
newspiderplot, \
for [f=1:|Array003|] Array003 u (Array003[f]) lc 3 fs pattern 5, \
keyentry w spiderplot lc 3 fs pattern 5 ti "Archer"
### end of script
结果: