【发布时间】:2020-04-21 10:01:13
【问题描述】:
【问题讨论】:
【问题讨论】:
这是一个所谓的蜘蛛网或雷达图。 Highcharts 有一个很好的实现 (https://www.highcharts.com/demo/polar-spider),你可以在 R 中使用 highcharteR 包访问它:http://jkunst.com/highcharter/highcharts-api.html
【讨论】:
名称基本上是雷达图。
在R 中,您应该使用fmsb 包和radarchart 函数。
下面是一个例子:
library(fmsb)
data <- as.data.frame(matrix( sample( 2:20 , 10 , replace=T) , ncol=10))
colnames(data) <- c("math" , "english" , "biology" , "music" , "R-coding", "data-viz" , "french" , "physic", "statistic", "sport" )
data <- rbind(rep(20,10) , rep(0,10) , data)
radarchart( data , axistype=1 ,
pcol=rgb(0.2,0.5,0.5,0.9) , pfcol=rgb(0.2,0.5,0.5,0.5) , plwd=4 ,
cglcol="grey", cglty=1, axislabcol="grey", caxislabels=seq(0,20,5), cglwd=0.8,
vlcex=0.8)
如果你想deep这里
您应该使用plotly 而不是Python。
import plotly.express as px
import pandas as pd
df = pd.DataFrame(dict(
r=[1, 5, 2, 2, 3],
theta=['processing cost','mechanical properties','chemical stability',
'thermal stability', 'device integration']))
fig = px.line_polar(df, r='r', theta='theta', line_close=True)
fig.show()
如果你想deep这里
【讨论】:
这叫做雷达(Excel 有这个名字)/蜘蛛/多边形图表。你可以使用python中有一个名为radar的包。你可以找到一个很棒的方法来用 python in this link自己画一个。
您只需要替换示例代码中的值
【讨论】: