How to remove border of bars from histogram in base R?


By default, a histogram drawn in base R has black color borders around bars. We might want to remove these black borders to make the histogram visually smooth. This can be done by using lty argument with the hist function. For example, if we have a vector x and we want to create a histogram of x without border of bars then we can use the argument as hist(x,lty="blank").

Example

> x<-rnorm(10000)
> hist(x)

Output:

Creating histogram of x without border of bars:

Example

> hist(x,lty="blank")

Output:

Updated on: 21-Nov-2020

634 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements