Using geom_path from ggplot library

前端 未结 1 1648
清酒与你
清酒与你 2021-01-12 09:47

I have 12 variables, M1, M2, ..., M12, for which I compute a certain statistic x.

 df = data.frame(model          


        
相关标签:
1条回答
  • 2021-01-12 09:48

    You have to use geom_polygon for closed paths:

    library(ggplot2)
    ggplot(data=df, aes(x=model, y=x, group=1)) + 
      geom_polygon(fill = NA, colour = "black") + 
      coord_polar() + 
      scale_y_continuous(limits=range(levels), breaks=levels, labels=levels) +
      theme(axis.text.y = element_blank(), axis.ticks = element_blank(), 
            axis.title.x = element_blank(), axis.title.y = element_blank())
    

    enter image description here

    0 讨论(0)
提交回复
热议问题