Welcome! In today's lesson, we are diving into styling plots. Styling is crucial to make plots visually attractive and insightful. We will delve into various aspects of plot style with R's ggplot2
, enhancing the aesthetics of our plots as we progress. Let's get started!
In ggplot2
, each plot can be styled differently. Here's an example with a basic line plot:
Have you ever wanted to change these defaults? Fortunately, ggplot2
allows you to do just that with the color
and linetype
parameters:
Voila! Our line is now red and dashed!
The fun part is that ggplot2
offers many color options (like 'green', 'blue', 'cyan', etc.) and line types (like 'solid', 'dotted', 'dashed', etc.). This flexibility allows you to create personalized and differentiated line plots.
