- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

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

To highlight a bar in base R histogram, we need to understand the X-axis values and pass the col argument inside hist function appropriately. We just need to put a separate value for the bar that we want to highlight and set the colouring of the rest of the bars to 0 (that is default in base R). Check out the below examples to understand how it works.

> x<-rnorm(100) > hist(x,col = c(rep(0,5),4,rep(0,5)))

> y<-rnorm(1000) > hist(y,col = c(rep(0,3),4,rep(0,9)))

- Related Questions & Answers
- How to create a histogram without bins in base R?
- How to create a horizontal line in a histogram in base R?
- How to create empty bar plot in base R?
- How to remove border of bars from histogram in base R?
- How to increase the thickness of histogram lines in base R?
- How to define the number of breaks in base R histogram?
- How to create a histogram with dots instead of bars in base R?
- How to create horizontal lines for each bar in a bar plot of base R?
- How to increase the X-axis length of histogram in base R?
- How to manually set the color of each bar in base R bar plot?
- How to create a histogram with main title in the outer margin of plot window in base R?
- How to create a histogram using weights in R?
- How to create horizontal histogram in R?
- How to create bar plot in base R with different limits for Y-axis?
- How to extract the frequencies from a histogram in R?

Advertisements