ANL501 Data Visualisation and Storytelling

Logo

Return to My Profile Page

View the Project on GitHub nicholas-sim/ANL501-Data-Visualisation-and-Storytelling

Seminar 3

This seminar presents the fundamental syntax and functionalities of ggplot. The syntax of ggplot adheres to the principles of the Grammar of Graphics for data visualization. First, through an example, we demonstrate how to construct a visualization using ggplot. Then, we explore the proper utilization of the aesthetic layer and other various layers of ggplot.

Getting Started with ggplot

This discussion focuses on the basic syntax and functionalities of ggplot. We discuss how the ggplot syntax is structured around the different layers expressed by the Grammar of Graphics. We discuss the basic differences between declaring the data and parameters globally versus locally and to syntax to overlay various layers such as trendlines and colors onto the base plot. The discussion concludes by demonstrating the visualization capabilities of R, such as the gganimate package, which easily produces animations for a static plot.

Aesthetics and Settings

This discussion explains the differences between an aesthetic and setting in the language of ggplot and how to use them correctly to enhance a data visualization for storytelling. Through an example, we explore how data storytelling can be enhanced by the appropriate use of aesthetics or settings, such as color, fill, size, among others.

Other Layers in the Grammar of Graphics

This discussion explores other optional layers in the Grammar of Graphics that are often used to improve the effectiveness of a data visualization. This includes the use of scales, coordinates, labels, statistics, facets, and theme. The discussion concludes with an example of how to employ some of these various elements for visualization.