- 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

# How to create a histogram with dots instead of bars in base R?

To create a histogram with dots instead of bars, we can use the plot function in base R. The x values will be based on the sorting of the vector values and the y values will be based on the sequence of the table for the vector values. Therefore, we would be needing sorting and table with sequence. Check out the below examples to understand how it can be done.

## Example1

> x1<-rpois(200,2) > plot(sort(x1),sequence(table(x1)))

## Output

## Example2

> x2<-round(rnorm(200,5,2),1) > plot(sort(x2),sequence(table(x2)))

## Output

- Related Questions & Answers
- How to remove border of bars from histogram in base R?
- How to create histogram like plot with different color of bars in R?
- How to create a histogram without bins in base R?
- How to create a horizontal line in a histogram in base R?
- Create histogram with horizontal boxplot on top in base R.
- How to highlight a bar in base R histogram?
- How to create a bar chart using ggplot2 with dots drawn at the center of top edge of the bars in R?
- How to fill histogram bars using ggplot2 in R with different colors?
- How to create a histogram with main title in the outer margin of plot window in base R?
- How to change the color of bars in base R barplot?
- How to create histogram with relative frequency in 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 horizontal histogram in R?
- How to create a bar plot in R with label of bars on top of the bars using ggplot2?

Advertisements