- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create horizontal lines for each bar in a bar plot of base R?
To create horizontal lines for each bar in a bar plot of base R, we can use abline function and pass the same values as in the original barplot with h argument that represents horizontal with different color to make the plot a little better in terms of visualization.
x<-c(24,25,22) barplot(x) abline(h=c(24,25,22),col="red")
 4 0 2 2 4
- Related Articles
- How to create empty bar plot in base R?
- How to manually set the color of each bar in base R bar plot?
- How to create a horizontal bar plot using barplot function in R?
- Create bar plot for grouped data of two columns in base R.
- How to create bar plot in base R with different limits for Y-axis?
- How to display x-bar in base R plot?
- How to create stacked bar plot in which each bar sum to 1 or 100% in R?
- How to create a horizontal bar graph using ggplot2 in R?
- How to create a bar plot with bars for missing values in R?
- How to create horizontal stacked bar chart using ggvis in R?
- How to create a bar plot using ggplot2 with one bar having black border in R?
- How to create transparent bar plot using ggplot2 in R?
- How to make a broken horizontal bar plot in Matplotlib?
- How to set the alignment of labels in horizontal bar plot to left in R?
- How to create a bar plot with ggplot2 using stat_summary in R?