Figure 2-1: A Default Scatterplot

Portfolio Categories: All Graphics and SGR Book Graphics.

fig-2-1-femlife plot

myDF = read.delim("http://www.kktg.net/R/Chapter2Data.txt", 
  header = TRUE,                       # Data has headers for var names
  colClasses = c("character",          # Set storage modes of variables
    "numeric", "numeric", "numeric",   # This is just a convenience and  
    "numeric", "factor", "numeric"))   #   could be adjusted afterwards

# A simple plot ----------------------------------------------------------------
png(filename = "illustrations/fig-2-1-femlife plot.png",
  units = "in",                        # Set measurements in inches
  res = 1200,                          # Set resolution at 1200dpi
  width = 6,                           # Width at 6 inches
  height = 4)                          # Height at 4 inches

par(mai = c(1, 1, .25, .25))

plot(myDF$PressStat, myDF$FemLife)     # Plot: femlife by free press

dev.off()                              # Output png file