Selects the colours depending on the current set theme.

scale_fill_discrete(..., type)

Arguments

...

Additional parameters passed on to the scale type,

type

One of the following:

  • A character vector of color codes. The codes are used for a 'manual' color scale as long as the number of codes exceeds the number of data levels (if there are more levels than codes, scale_colour_hue()/scale_fill_hue() are used to construct the default scale). If this is a named vector, then the color values will be matched to levels based on the names of the vectors. Data values that don't match will be set as na.value.

  • A list of character vectors of color codes. The minimum length vector that exceeds the number of data levels is chosen for the color scaling. This is useful if you want to change the color palette based on the number of levels.

  • A function that returns a discrete colour/fill scale (e.g., scale_fill_hue(), scale_fill_brewer(), etc).

Author

Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof