Figure 5-1: A Default Histogram

Portfolio Categories: All Graphics and SGR Book Graphics.

fig-5-1-histogram


myVar = seq(-3, 3, .0001)              # Set up a variable with .0001 intervals
myNormVar = rnorm(myVar)               # Create random normal variable on myVar

png(filename = "illustrations/fig-5-1-histogram.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))           # Set margins - no Title

hist(myNormVar, main = NA)             # Histogram plot of normal variable
                                       #  with title (main = ) turned off
dev.off()
                                       # Output png plot