- 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

The histogram like plot in base R is the plots of vertical lines instead of points in a vector or column of a data frame. If we increase the width of these lines then the plot becomes more like a histogram as the increment in widths make the vertical lines look like bars.

To increase the width of lines for histogram like plots in base R, we can use lwd argument.

Check out the below example to understand the difference between point chart and histogram like plot in base R.

Use the code given below to increase the width of lines for histogram like plots in base R −

plot(1:5)

If you execute the above given code, it generates the following output −

For the histogram like plot, add the following code to the above snippet −

plot(1:5,type="h")

If you execute all the above given snippets as a single program, it generates the following output −

For histogram like plot with larger width of lines, add the following code to the above snippet −

plot(1:5,type="h",lwd=15)

If you execute all the above given snippets as a single program, it generates the following output −

- Related Questions & Answers
- How to increase the thickness of histogram lines in base R?
- How to increase the X-axis length of histogram in base R?
- How to create boxplot in base R with higher width of the box lines?
- How to increase the width of the lines in the boxplot created by using ggplot2 in R?
- How to increase the width of axes using ggplot2 in R?
- How to define the number of breaks in base R histogram?
- How to highlight a bar in base R histogram?
- How to increase the axes tick width using ggplot2 in R?
- How to remove border of bars from histogram in base R?
- How to create multiple plots of different sizes in base R?
- How to increase the width of the median line in boxplot using ggplot2 in R?
- How to create a histogram without bins in base R?
- How to create horizontal lines for each bar in a bar plot of base R?
- How to increase the width of the X-axis line for a ggplot2 graph?
- How to create histogram like plot with different color of bars in R?

Advertisements