The scale_colour_fermenter() function is used to set the colors for a plot using a palette from the Fermenter package.
scale_fill_fermenter( type = "seq", palette = 1, direction = -1, na.value = "grey50", guide = "coloursteps", aesthetics = "fill" )
- type: It is one of “seq” (sequential), “div” (diverging), or “qual” (qualitative)
- palette: If a string will use that named palette. If a number is indexed into the list of palettes of the appropriate type. The list of available palettes can be found in the Palettes section.
- direction: It sets the order of colors in the scale. If 1, the default colors are as output by RColorBrewer::brewer.pal(). If -1, the order of colors is reversed.
- aesthetics: The character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with.
- na.value: It is a color for missing values
- guide: Type of legend. Use “colourbar” for continuous color bar or “legend” for discrete color legend.
library(ggplot2) # Create a scatterplot of mpg vs. hp, with points colored # by the number of cylinders p <- ggplot(mtcars, aes(x = hp, y = mpg, colour = cyl)) + geom_point() # Adjust the color of the points using the # scale_colour_fermenter() function p + scale_colour_fermenter(palette = 1, name = "Cylinders")