hist
generates a histogram with the vertical boundaries of bars plots. If I don't want to draw the vertical boundaries that are common between adjacent bars, is there a way to do so?
CodePudding user response:
If you want to retain the outline, it's pretty trivial to draw a polygon over the histogram:
set.seed(1)
h <- hist(rnorm(50))
polygon(rep(h$breaks, each = 2), c(0, rep(h$counts, each = 2), 0), col = "gray")
CodePudding user response:
First some reproducible data:
set.seed(42)
x <- rnorm(100, 15, 4)
The border=
argument is documented on the manual page for hist
(?hist
):
hist(x, border="lightgray")