gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 03:25:48 28 4
gpt4 key购买 nike

我想使用 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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com