rpolygonradar-chart

How to fill the polygons of the radar chart in ggradar in R


I'm plotting the radar chart using ggradar and I would like to fill the polygons of the chart with different colours. Does anyone know how to do this?

Also, how to remove the legend? I cannot remove the legend even thought I've added plot.legend=FALSE.

Here is the code I'm using.

ggradar(dg, group.point.size=1,
        axis.labels=c("Depression", "Stress", "Anxiety"), label.centre.y=FALSE, plot.legend=FALSE, values.radar =c("","",""))

Thanks very much! enter image description here


Solution

  • Not a ggradar() solution -look here-, but you can work with ggplot() an ggiraphExtra() packages (data are the famous iris dataset, due you did not provide any data):

    library(ggplot2)
    library(ggiraphExtra)
    
    radar <- ggRadar(data=iris,aes(group=Species), alpha = 0.3) + # alpha for polygon colors intensity
             theme_light() +                                      # white background etc.
             theme(legend.position = 'none')                      # no legend
    radar
    

    enter image description here

    You can tweak as you want.
    And you can save it:

    ggsave(filename="radar.png")