【问题标题】:Is anyone familiar with the name of this plot?有人知道这个情节的名字吗?
【发布时间】:2020-04-21 10:01:13
【问题描述】:

我想知道《赢十一局》中的这个情节叫什么:

有没有办法使用 Python 或 R 来创建它?谢谢大家:)

【问题讨论】:

    标签: python r plot


    【解决方案1】:

    这是一个所谓的蜘蛛网或雷达图。 Highcharts 有一个很好的实现 (https://www.highcharts.com/demo/polar-spider),你可以在 R 中使用 highcharteR 包访问它:http://jkunst.com/highcharter/highcharts-api.html

    【讨论】:

    • 我明白了.. 确实是一个很棒的 AP​​I :),谢谢您的参考
    【解决方案2】:

    名称基本上是雷达图。

    在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这里

    【讨论】:

    • 谢谢你的例子参考@slowLearning,欣赏它
    【解决方案3】:

    这叫做雷达(Excel 有这个名字)/蜘蛛/多边形图表。你可以使用python中有一个名为radar的包。你可以找到一个很棒的方法来用 python in this link自己画一个。

    您只需要替换示例代码中的值

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-05
      • 2011-07-23
      • 1970-01-01
      • 2014-08-28
      • 1970-01-01
      相关资源
      最近更新 更多