Why is ggradar polygon fill colour different to polygon colour?

162 Views Asked by At

I have a dataframe, sampdf, which looks like this:

name cat1 cat2 cat3 cat4 cat5
Any Name 0.6198695 0.8864993 0.6239897 0.9735296 0.9735149

I wish to plot this as a (filled) polygon using ggradar.

Here's my code:

ggradar(sampdf, 
        group.colours = "slateblue4", 
        fill="TRUE", 
        group.point.size = 2, 
        font.radar = "NeueHaasDisplay-Roman", 
        axis.label.size = 6) +
  theme_void() +
  theme(legend.position = "none")

Here's the resulting chart:

radar chart for sampdf

Why is the fill colour red rather than slateblue4? Apologies if there is something simple I'm missing but this is driving me crazy!

Tried the code above, expecting the fill colour to be slateblue4, in fact it was red

1

There are 1 best solutions below

0
On

Your code is almost correct, you just need to unquote TRUE in the fill argument e.g. :

sampdf <- tibble::tribble(
  ~name,    ~cat1,  ~cat2,  ~cat3,  ~cat4,  ~cat5,
  "Any Name",   0.6198695,  0.8864993,  0.6239897,  0.9735296,  0.9735149
)

ggradar(sampdf, 
        group.colours = "slateblue4", 
        fill=TRUE, 
        group.point.size = 2, 
        font.radar = "NeueHaasDisplay-Roman", 
        axis.label.size = 6) +
theme_void() +
theme(legend.position = "none")

which gives:

Radar chart with blue fill colour