I want to illustrate R's par()
graphics parameter command with multiple graphs, so I did a simple 2×2 layout that's graphed great. I added a single par (col = "green")
command to cause the one barplot()
and three hist()
ograms, but it did nothing that I could see.
Here's my R script, which should be safe since I save and restore your graphics settings at the top and bottom. Apologies for the long dput()
but I want you to have the data I have.
savedGraphicsParams <- par(no.readonly=TRUE)
layout(matrix(c(1, 2, 3, 4), nrow=2, byrow=TRUE))
par(col = "green") # doesn't work
attach(Lakes)
# GRAPH 1:
barplot(table(N_of_Fish), main="Fish", xlab = "No. of Fish")
# GRAPH 2:
hist(Elevation, main = "Elevation", xlab = "ft")
# GRAPH 3
hist(Surface_Area, main="Surface Area", xlab = parse(text="ft^2"))
# GRAPH 4
hist(`, main="Max Depth", xlab = "ft")
detach(Lakes)
par(savedGraphicsParams) # Reset the graphics