graph - 如何在 Gnuplot 中创建蜘蛛图?

标签 graph plot gnuplot

我想使用 Gnuplot 生成蜘蛛图(又名雷达/星形图),其中不同的轴具有独立的比例。我能够使用 OriginPro(商业)生成这样的图,但使用 Gnuplot 我只能设置具有统一比例的雷达图。

(csv 文件)数据集如下所示(第一行是列标签):

# FEATURE, Product_A, Product_B, Product_C, Product_D
attribute_1, 2, 10, 7, 3.5
attribute_2, 1, 0.5, 3,4
attribute_3, 37, 58, 49, 72
attribute_4, 1985, 1992, 2006, 2010
attribute_5, 0.1, 0.5, 0.3, 0.8

我正在寻找的情节是这个:https://www.dropbox.com/s/uvqubzqvm6puhb8/spider.pdf - 正如您所看到的,每个轴代表不同的属性,并且有自己的比例。

我猜 Gnuplot 起始代码是:

set polar
set grid polar
set angles degrees
set size square
set style data filledcurves

但我不知道如何继续。有什么建议吗?

最佳答案

这是一次黑客尝试..

set nokey
set polar
set grid polar
set angles degrees
set size square
set style data lines
a1=0
a2=30
a3=100
a4=200
a5=300
set arrow nohead from 0,0 to first 10*cos(a1) , 10*sin(a1)
set arrow nohead from 0,0 to first 10*cos(a2) , 10*sin(a2)
set arrow nohead from 0,0 to first 10*cos(a3) , 10*sin(a3)
set arrow nohead from 0,0 to first 10*cos(a4) , 10*sin(a4)
set arrow nohead from 0,0 to first 10*cos(a5) , 10*sin(a5)
set xrange [-10:10]
set yrange [-10:10]
plot '-' using ($1==1?a1:($1==2?a2:($1==3?a3:($1==4?a4:($1==5?a5:$1))))):2 lt 2
1 4
2 8
3 6
4 9
5 5
1 4

关于graph - 如何在 Gnuplot 中创建蜘蛛图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12709820/

相关文章:

r - 使用 'directlabels' 包来标记选择曲线

ubuntu - 使用 Gnuplot 制作多重折线图

gnu - 如何在gnuplot中设置关键字体大小?

Gnuplot - 如何用二次场绘制热图

java - 将社交网络数据加载到 Neo4J 中

graph - Lisp - 编写一个计算图节点标签的函数

JAVA:在一组边中查找多边形

r - 如何在 R 中创建具有对齐节点的有向网络图?

为系列绘制的 R plotCI 错误分配的颜色

r - 如何在绘图期间打开新的绘图窗口