Lesson 15: Visualizing Data I - Enhancing Scatter Plots
Lesson 15: Visualizing Data I - Enhancing Scatter PlotsOverview
In this chapter we'll begin a somewhat more detailed examination of the graphical capabilities in R, and here we'll focus on scatterplots.
Objectives
- Create a scatterplot with legend
- Create scientifically formatted axis labels
- Create multipanel plots
- Create plots with a secondary y-axis
R
The R code file and data files for this lesson can be found on the Essential R - Notes on learning R page.
15.1 - Basic Use of plot()
15.1 - Basic Use of plot()We've already used plot()
, but without much discussion of what it can do. Here we'll look a bit more at (some of) the features of plot()
. Note that there is a lot happening in the background when we call plot()
- a coordinates system is set up, default axis labels generated, and rang limits for the axes are selected.
15.2 - Introducing lines() and Formatting Axis Labels
15.2 - Introducing lines() and Formatting Axis LabelsWe can add any arbitrary line segements to a plot using lines()
, as we'll demonstrate here. We'll also look at how we can control the format of axis labels.
15.3a - Putting Together a Publication-Quality Scatter Plot
15.3a - Putting Together a Publication-Quality Scatter PlotNow we'll put together what we've done so far to create a polished plot.
15.3b - Introducing layout() for Multi-Panel Plots
15.3b - Introducing layout() for Multi-Panel PlotsHere we'll introduce the function layout()
for creating multipanel plot layouts.
15.4 - Controlling Plot Dimensions - quartz() and x11()
15.4 - Controlling Plot Dimensions - quartz() and x11()When you are working on plots, you may want to control the size of the plotting window. This can be done using X11()
or quartz()
to open a new graphical device whose size you can control.
15.5 - Creating a Finished Multi-Panel Plot - Part I
15.5 - Creating a Finished Multi-Panel Plot - Part INow we'll put everything together to create a publication-quality multi-panel plot.
15.6 - Creating a Finished Multi-Panel Plot - Part II
15.6 - Creating a Finished Multi-Panel Plot - Part IIThis is a continuation of the last video on creating a multipanel plot.
15.7 - Using Loops for Multi-Panel Figures
15.7 - Using Loops for Multi-Panel FiguresHere we'll consider if and when it would make sense to use a loop to create multipanel plot.
15.8 - Adding a Secondary y-axis
15.8 - Adding a Secondary y-axisWe'll wind up this chapter with a demonstration of how to add a secondary y-axis to a plot.