Choosing color combinations and palettes
We often need more than one color to represent various elements in graphs. Palettes are combinations of colors, which is a convenient way to use multiple colors without choosing individual colors separately. R provides inbuilt color palettes as well as the ability to create our own custom palettes. Using palettes is a good way to avoid repeatedly choosing or setting colors in multiple locations, which can be a source of error and confusion. This helps in separating the presentation settings of a graph from the construction.
Getting ready
All you need to try out in this recipe is to run R and type the recipe in the command prompt. You can also choose to save the recipe as a script so that you can use it again ...
Get R: Data Analysis and Visualization now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.