x1 <- 1:10
y1 <- c(2, 4, 7, 4, 5, 8, 6, 6, 1, 2)
plot(x1, y1,
type = "l", # Set line type to line
lwd = 4) # Thickness of line
# X-Y-Coordinates of polygon
polygon(c(1, x1, 10), c(0, y1, 0),
col = "darkgreen")
# Add squares to frequency polygon
points(x1, y1,
cex = 1, # Size of squares
pch = 12)
segments(x1, 0, x1, y1)