
Install the software on Linux, Mac, or Windows and set up RStudio. Brush up on dplyr, tibble, and data transformation basics with R for data science to prepare for ggplot2.
Access the course materials on GitHub, including best practice visualizations, cheat sheets, and data sets. Explore module scripts and project structure to guide ggplot2 learning from beginner to advanced.
Work with the World development indicators dataset from the World Bank, featuring forest lands, per capita, and life expectancy; three datasets are cleaned and provided in the data folder.
Learn to build data visualizations from scratch in ggplot2, mastering aesthetic mappings, line, scatter, and area charts. Practice with step-by-step modules and real-world datasets to create confident, polished visuals.
Explore how data visualizations work by mapping geometric objects to data variables through aesthetics, using life expectancy plots to place year on the x-axis and life expectancy on the y-axis.
Explore how aesthetics govern geometric objects like points, rectangles, and lines, including size, color, alpha, and border, and the x and y aesthetics for mapping to data.
Distinguish discrete and continuous data types with examples like country and life expectancy, and use the claims function to identify types and their plotting styles.
Map data to aesthetics through aesthetic mappings in a scatterplot. Map year to x and life expectancy at birth to y, and adjust alpha, size, and color for visual meaning.
Explore the difference between mapping and setting aesthetics in ggplot2 using a histogram, showing how to map variables to aesthetics and how to set fixed attributes like color and alpha.
Learn to craft ggplot2 aesthetic mappings, including static mappings, mapping the X and Y aesthetics, and color or fill to discrete or continuous variables.
Translate aesthetic mappings into plots in ggplot2, distinguishing discrete and continuous variables like continent and life expectancy at birth, and visualize GDP per capita, birth rate, and internet usage.
Master the ggplot2 aesthetic mappings by avoiding duplicate aesthetics, map x to continent and y to GDP per capita, and reuse variables across fill or color without repeating same aesthetic.
Practice ggplot2 by recreating the data frame for a bar plot, map x to country and y to life expectancy at birth, and identify set aesthetics.
Demonstrate why a bar plot is hard to understand when the y axis and axis titles are missing and legends don’t indicate what the aesthetics map to.
Explore how aesthetic mappings connect data variables to visual properties of geometric objects. Note that some aesthetics may be set, not mapped.
Define the plot function with data and mapping arguments to build a scatterplot, using the World Bank countries dataset and CO2 emissions per capita versus GDP per capita.
Set up the ggplot2 canvas by defining the data set and continuous x and y aesthetics before adding geoms, then apply the same aesthetics to line, area, and box plots.
Create a line chart with the World Bank Areas dataset to track forest land as a percent worldwide from 1960 to today, using aesthetics, filtering, and area-based colors.
Build an area chart in ggplot2 to show how the percentage of women in national parliaments has changed across world areas, with year as x and percent as y.
Create a ggplot2 scatterplot mapping x to gdp per capita and y to birth rate, filter for 2017, and map color by continent to reveal wealth and fertility trends.
Create and customize histograms to visualize one-variable distributions, map a continuous variable to x, adjust bin width, fill, border, and alpha for clarity.
Create box plots in ggplot2 to compare obesity rates across continents using discrete x and continuous y aesthetics, mapping fill and color to continent and adjusting alpha and borders.
Learn to build ggplot2 bar charts with two mappings for x and y, convert year to a factor for fill color, and compare stacked and side-by-side layouts for CO2 emissions.
Explore advanced ggplot2 concepts by applying geom_text and geom_label to annotate an Africa 2015 plot of internet usage versus mobile subscriptions, focusing on continuous and discrete aesthetics.
Generate a geom_jitter scatter plot of renewable energy consumption by continent for 2015 in ggplot2, adjusting width, alpha, and color aesthetics to reduce overlap and distinguish continents.
Master ggplot2 error bars with geom_errorbar, geom_linerange, and geom_pointrange to visualize continental overweight ranges, mapping continent and bounds from the overweight summarized data.
Master best practice plots in ggplot2 by building an area chart of internet usage across World Bank areas, mapping area to fill and refining visuals across modules.
Investigate renewable energy consumption in Denmark, Sweden, Finland, and Norway from 1990 to today using a line chart with year and consumption on axes, colored by country.
Explore a best practice forest land visualization across areas and years using bar charts, mapping year to fill color, adjusting to side-by-side or stacked layouts, and refining aesthetics.
Master advanced ggplot2 techniques by visualizing life expectancy across continents from 1960 to today using a ribbon plot, with mean, min, and max bounds and color mapping.
Combine multiple geometric objects with a plus sign to layer them, with the last object on top, and ensure shared mappings and data types across geoms, box plots and points.
Layer geom_text over geom_point in a 2016 World Bank income scatterplot with GDP per capita on the x-axis and birth rate on the y-axis, using nudge_x and nudge_y for readability.
Layer a bar chart of continents with geom_col, add geom_errorbar to show min and max values, and overlay geom_point for median, illustrating how to visualize variability in ggplot2.
Learn to layer geom_col with geom_text in ggplot2 to display co2 emissions per capita by income group, with values shown on top of bars and practical tips on aesthetic mappings.
Explore the inheritance of static mappings in ggplot2, and learn how applying aesthetics to geometric objects can alter color inheritance and plot appearance.
Master common ggplot2 pitfalls by distinguishing the plus operator from the pipe, fixing mapping aesthetics errors, and plotting obesity rates by continent after filtering for 2016.
Master typical grouping issues in geom_line by using the group or color aesthetics to create multiple lines for each country; ensure data are ordered by year and inspect grouping variables.
Master dodging bar charts in ggplot2 by transforming stacked bars to side-by-side with position dots and position touch, adjusting bar width and gaps for readability.
Apply dodging bar charts in ggplot2 by overlapping or separating bars, using width and assigned width calculations with position_dodge and position_dodge2, and adjusting alpha for clarity.
Explore three ggplot2 methods to order discrete variables in bar charts: convert to a factor with explicit levels, use reorder, or apply factor order to CO2 emissions by income group.
Explore how ggplot2 aesthetics affect geom_point and geom_jitter, show how color, fill, stroke, and shape numbers shape borders in a GDP versus life expectancy scatterplot, with a cheat sheet.
Recreate a ggplot of renewable energy consumption by year for China, Germany, India, and the United States, with lines grouped by country and overlaid points bordered in white.
Create a ggplot2 visualization of birth rate in China from 1960 to 2018 using the dataset, layering points and labels on peaks and refining color and borders.
Recreate a ggplot of obesity by continent from 2010 to 2016, using line ranges to show lower, median, and upper values alongside points; order continents by median and adjust positions.
Learn best practice visualizations for forest land plots: reorder bars in descending order, adjust width and gaps, and apply alpha to reveal lines; explore adding geometric objects on a plot.
Explore an interactive app to map aesthetics for ggplot2 geoms like rug, raster, and violin, and learn how color, alpha, and x–y mappings reveal continent distributions.
Explore how ggplot2 scales translate data into visuals, and customize axes, legends, and colors using scale types like scale fill, scale x discrete, and scale y continuous.
Categorize the five types of scales in ggplot2: variable scales, shortcut scales, named scales, bean scales, and manual scales, and illustrate using a bar chart.
Explore how to choose and customize ggplot2 scales using an interactive Scale App, covering discrete and continuous aesthetics, color scales, breaks, limits, hue, and expansion.
Explore how to set x and y scale limits with scale_x/y_continuous and the limits argument to zoom or cut axes, and why coord_cartesian solves data disappearance when zooming.
Explore how breaks and minor breaks control ggplot2 axis grids on the x and y scales. Learn to use sequences and value vectors to shape major and minor grid lines.
Explore how to customize y and x axis labels in ggplot2 by using breaks, minor breaks, and label vectors, and apply function-based label formatting.
Learn to use the scarce package to customize x-y axis scales and continuous scales with label functions for currency, percentages, and scientific notation, and apply breaks extended for clear visuals.
Learn how ggplot2 color and fill scales map discrete and continuous variables, using manual scales and palettes like culebra, pilbara, veritas, with begin and end controls and colorblind options.
Explore how to use color and fill scales in ggplot2, including discrete, sequential, and diverging palettes from color brewer and veritas, with hue adjustments, lightness, and accessibility considerations.
Explore how to apply continuous color scales in ggplot2, using color distiller and fermenter scales, and learn gradient scales, including gradient, gradient2, and step (binned) palettes for continuous variables.
Explore color and fill scales in ggplot2, including continuous palettes, diverging and gradient scales, binning with bean scales, and guidance for time and date variables.
Explore how to handle date, datetime, and time variables in ggplot2, including choosing the right scale, using date breaks, labeling formats, and working with daytime and time scales.
Recreate a ggplot2 population-by-income plot using discrete color mappings and a dusty color scale, then adjust axis labels with scarce and rename the y-axis to total population.
Refine a ggplot2 histogram of women in parliaments by displaying x axis in percent, adjusting breaks, and removing extra space with scale_x_continuous and expand.
Recreate a scatterplot of GDP per capita versus life expectancy, adjust point fill colors with a discrete scale, experiment with magma and inferno palettes, and customize the legend and x-axis.
Explore exercise 4 in ggplot2 by adjusting the y axis breaks from zero to twelve point five with even distribution and applying a discrete hue fill by year.
Modify a ggplot2 line chart of renewable energy by applying manual color scales, adjust axis limits, and remove the legend for clear cross-country comparison.
Explore ggplot2 customization by converting a bar chart to overweight in percent with percent labels, color changes, and manual scale settings using scales and discrete scales.
Refine ggplot2 best practice visuals for internet usage by adjusting x and y scales, limits, and expansion, and tuning labels, breaks, and colors to show energy use in billions.
Master best-practice ggplot2 visualization for renewable energies by refining scales, breaks, limits, axis labels, and colors, and ensure country order matches color mapping while removing the legend.
Fine-tune forest land visualizations in ggplot2 by setting the y axis breaks and limits, applying percent labels with scales, removing axis titles, and using a manual color palette.
Apply best practice visualization techniques to the life expectancy dataset by refining x and y axes, removing the legend, adjusting breaks and limits, and using suffix labels.
Master expanding continuous axes in ggplot2 by setting axis limits on scale_x_continuous and using expand, ad, and mud arguments to add or remove left and right space on both axes.
Learn how to use ggplot2's expand argument with discrete scales to control left and right margins, using inner width, add and mud arguments to adjust spacing between bars.
Explore how to use after_scale in ggplot2 to modify colors after mapping, including desaturated, darkened, and nested prismatic functions for color blind considerations.
Explore faceting to create small multiples by panels that display data by a discrete variable, making cross-continent trends and relationships, like GDP per capita vs birth rate, easier to compare.
Explore facet_wrap in ggplot2 by using a discrete variable with either tilde notation or vars, customize columns and rows, adjust direction, and free scales for flexible panels.
Free scales can mislead readers about heights. Free the y scale to reveal distinct ranges for birth rate, GDP per capita, and population total, using facet wrap on long-format data.
Use facet_grid to create a facet layout for two discrete variables, mapping continent to rows and year to columns, and compare GDP per capita and birth rate trends across panels.
Learn to control facet panel order in ggplot2 by converting a variable to a factor and leveling it with factor levels, enabling west-to-east or custom panel sequences.
Learn to compare continents by layering additional points in ggplot2 panels, using the data argument and facet grid to show GDP per capita and birth rate across years.
Demonstrates converting a continuous year variable into discrete bins with cut and cut interval, then facet_wrap by time to compare GDP per capita and birth rate.
Master best practice visualization in ggplot2 by using facets to create life expectancy panels across continents. Adjust colors, ribbons, and panel order to produce a neat, five-panel comparison.
Learn to use stat_summary in ggplot2 to compute mean and standard deviation per continent and year for forest land, with fewer lines of code and reusable layers.
Explore how ggplot2 implicitly uses summary statistics in bar and histogram plots, and learn how the stats summary function enables means, medians, and measures of spread.
Explore the stat_summary function in ggplot2, learn three types of summaries—central tendency, spread via min–max or confidence intervals—and how to layer summaries on plots.
Explore plotting measures of center in ggplot2 using stat_summary with mean or median. Visualize with line, area, and bar charts, and tune mappings, alpha, and position.
Learn to plot measures of spread in ggplot2 using stat_summary with minimum and maximum, ribbons and crossbars, to compare obesity across continents, with mean, median, standard deviation, and confidence intervals.
Explore how to plot measures of spread in ggplot2 by visualizing standard deviation, standard error, and confidence intervals using stat_summary and the fun data approach across continents and years.
combine stat_summary functions to plot co2 emissions in 2017 using bar charts with mean and alpha 0.6, error bars, then a line chart with min, max, and standard deviation ribbons.
Explore best practice life expectancy visualizations in ggplot2 using stat_summary, ribbons, and lines for each country to compare across continents.
Explore how to use ggplot2 theme to customize non-geometric visuals, transform defaults like the grey panel, grid lines, adjust text sizes, and reposition legends for papers, presentations, and conference papers.
Explore predefined ggplot2 themes and theme functions to quickly style plots, then learn to customize margins, borders, and fonts using installable packages for publications and posters.
Explore the theme function in ggplot2 and categorize its components into five groups: plot, panel, axis, strip, legend. Use code snippets to adjust margins, grid lines, and legend placement.
Master the four theme building blocks in ggplot2—element_rect, element_line, element_text, and element_blank—and learn to adjust fill, color, and text properties to customize plots.
Master ggplot2 styling with element_rect by adjusting the four key arguments—fill color, color, size, and linetype—to customize panel and plot backgrounds, borders, and legends.
Use element_line to customize axis and grid lines in ggplot2 by adjusting color, size, and line type, trying solid, dashed, and dotted styles, as well as rounded line endings.
Use labs to add a title, subtitle, and caption to a ggplot, demonstrating how element_text and labels enrich a plot about overweight rates across continents with World Bank data.
Master element_text to customize plot text, including font family, size, color, bold, centering with the just argument, and margins, using extra fonts and font import.
Learn to remove plot components with element_blank in ggplot2, such as the panel background, axis text, titles, and ticks, using core elements like text, rectangle, line, and element_blank.
Learn to design a theme in ggplot2 by adding a margin around the plot with the plot margin and unit function, using a vector of four values in centimeters.
Discover how to prevent overlapping text in ggplot2 by wrapping subtitles and axis labels. Use str_wrap, wrap with a width setting, and techniques like paste0 to create readable plots.
Adjust grid lines in ggplot2 by controlling major and minor lines, axis visibility, and breaks, then apply these techniques to enhance readability of box plots and other charts.
learn how to match the text size between geom_text and theme element_text in ggplot2 by applying a 2.8 conversion factor, ensuring consistent label sizing in a scatter plot.
Explore how the strip—the background rectangle above panels—defines facet visuals and text, and learn to customize its background color, text, font, size, wrapping, borders, and spacing.
Explore how to design and customize the ggplot2 legend, including the legend box, background, borders, position, direction, and margins for multiple legends.
Design and customize ggplot2 legends by adjusting columns, key size, and colors with guides and theme settings, including legend title, text, alignment, margins, and best practice visualizations.
Create a reusable base theme for ggplot2 and apply it to every plot using theme_set, use theme_get to inspect the current theme, and reset to the default when needed.
Apply best practice life expectancy visualizations by tuning a themed ggplot with a bold title, clear subtitle, World Bank caption, and refined axis labels, grid lines, margins, and fonts.
Enhance renewable energies best-practice plots by adding a theme, labels, and a title, subtitle, and caption, then adjust margins, grid lines, and axis text for clarity.
Improve ggplot2 visuals by applying best practice techniques: adjust panel, grid, axis text, and a top legend, plus create internet users as internet usage multiplied by population total.
Master best practices for forest land visualizations in ggplot2 by improving labels, title, subtitle, and caption, placing the legend at the bottom, and customizing panel background and grid lines.
Learn to add mathematical notation to ggplot2 plots using the expression or text function, including superscripts, subscripts, Greek symbols, fractions, and square roots.
Add annotation layers to ggplot2 plots with the annotate function, placing text and segments not mapped to data, and manage continent-specific or Merkel annotations across panels.
Add p-values to bar charts in ggplot2 by overlaying a second data layer for significance lines and text annotations, using a new dataset to plot between Asia and Europe.
Add regression lines to scatterplots in ggplot2 with geom_smooth using method = 'lm', remove the standard error, and map color or facet by continent to display multiple lines.
Learn to add functions and sampling distributions to ggplot2 plots using function and stat function, including normal distributions, area versus line charts, and layered parameters.
Learn to create variables on the fly in ggplot2 aesthetics to compare groups, plot means with stat_summary, and explore relationships such as birth rate by country and GDP per capita.
Learn to add labels near lines in ggplot2 line charts by creating a country label data layer, filtering for four countries, and nudging labels to line ends for readability.
Combine multiple ggplot2 plots into one image with patchwork, using plus signs for side-by-side layouts and backslashes for stacking. Use layout strings and plot_layout to craft custom grids.
Export ggplot2 plots to high-quality pdf files by saving the last plot with a file name, format, and dpi; adjust width, height, units, and aspect ratio.
Explore best practice life expectancy visualizations by adding axis annotations, continent labels, and event annotations; export and fine-tune sizing, placement, and styling for readability.
Compare the renewable energies plot, remove excess lines, add a y axis title and near-line labels, color Norway green and other Scandinavian countries bold, and export the final plot.
Master best practices in ggplot2 visualization by adding annotations, aligning text, drawing reference lines, and adjusting legend spacing using polygon three function, with a case study on internet usage.
Apply best practice viz in ggplot2 by adding an annotation for forest land percent of land area, then adjust label size, color, background, and axis limits to finalize the visualization.
My goal with this course is for you to learn ggplot2 from the ground up. ggplot2 has a huge community and endless resources, but here's why I think this course might be for you:
Creating data visualizations in ggplot2 is tough for beginners. You need to know about data types, geometric objects, aesthetics, aesthetic mappings, dozens of functions, faceting, scales, themes and much more. You'll find many resources on the internet that teach you this content. Finding these resources takes time, and often they don't teach the fundamentals you need to know to become an independent data visualization specialist in ggplot2. This course will get you up to speed with ggplot2. While creating this course I not only created the videos, but also a comprehensive package of educational materials. Here is what you will get from this course:
More than 12 hours of videos
8 brand-new cheat sheets on the most fundamental concepts of ggplot2 which you won't find anywhere else on the internet
3 educational web apps on three of the most fundamentals problems: findings aesthetics of geometric objects, finding scales, and designing your theme
A repository with all the R-code for the course
In this course we will start with the most important concept of ggplot2, aesthetic mappings. We will then learn how to create the most basic plots. Once you are able to create these plots, we will discuss common pitfalls that beginners to ggplot2 often run into. In the next modules, you will learn how to customize aesthetic mappings with scales, how to create multiple plots by faceting, how to calculate summary statistics, and how to change the theme of your plots. Finally, you will get to know tips and tricks that everyone learning ggplot2 should know. Along the way, we will also create four best practice visualizations that cover all of the fundamental concepts we learn in this course.
I am confident that you won't find similar material anywhere else on the internet and that you will truly understand ggplot2 from the ground up if you take this course.
Disclaimer: We will cover version 3.3.4 of ggplot2.