In this chapter, we will go through the main plot types that can be realized with ggplot2
. In the examples, we will use the qplot()
basic function so that you have a reference for how to realize such plots, even if you are not interested in a more detailed personalization of the graph details. We will see how to realize the following plots:
Histograms and density plots
Bar charts
Boxplots
Scatterplots
Time series plots
Bubble charts and dot plots
In Chapter 3, The Layers and Grammar of Graphics, we will describe the use of the ggplot
function, and in the equivalent coding between qplot
and ggplot
, we will also discuss how to realize the plots with such a sophisticated function.