- Related Questions & Answers
- How to create horizontal histogram in R?
- How to add a horizontal line in a boxplot created in base R?
- How to create a plot with dashed regression line in base R?
- How to create a histogram using weights in R?
- How to create a transparent histogram using ggplot2 in R?
- How to create a dashed line that passes through Y = 1 in base R?
- How to create a histogram with main title in the outer margin of plot window in base R?
- How to remove border of bars from histogram in base R?
- How to create a predictive linear regression line for a range of independent variable in base R?
- How to create a rectangle inside boxplot in base R?
- How to create a plot in base R without margins?
- How to create horizontal line for a range of values in a plot created by using ggplot2 in R?
- How to create a horizontal bar graph using ggplot2 in R?
- How to create heatmap in base R?
- How to create histogram with relative frequency in R?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

A horizontal line in a histogram is not much useful but we might want to create it in some situations such as where we want to display a specific value on the Y-axis that helps us to differentiate in the density of frequencies above or below a certain value. To create a horizontal line in a histogram, we simply need to use abline function as shown in the below example

> x<-rnorm(1000) > hist(x) > abline(h=100)

> abline(h=100,col="blue")

> abline(h=100,col="blue",lwd=5)

Advertisements