...

/

Customizing a Figure in R

Customizing a Figure in R

Learn to customize figures in R.

There are a lot of different ways to customize a figure in R. Here’s a non-exhaustive list of important and useful functions for us to know to effectively customize our figures.

Changing colors

While the default colors chosen for us in the ggplot2 package are quite appealing, sometimes we may want to specify other colors. When we change the ways that the data is mapped to the figure, we’re changing a scale. Thus, to customize our colors, we usually use either scale_fill_manual() or scale_color_manual(), depending on whether we’ve filled our object or colored it. For example, in our density plot earlier, we filled ...