- 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

Gridlines are the horizontal and vertical dotted lines, and they help to organize the chart so that the values on the labels becomes better readable to viewers. This is helpful specially in situations where we plot a large number of data points. A graph drawn by plot function can have gridlines by defining the vertical and horizontal lines using abline.

Consider the below data and scatterplot −

> x<-rnorm(10) > y<-rnorm(10,1.5) > plot(x,y)

Adding gridlines using abline function −

> abline(h=seq(0,5,0.5),lty=5) > abline(v=seq(-2,2,0.5),lty=5)

- Related Questions & Answers
- How to create a plot in R with gridlines using plot function?
- How to create a bar graph using ggplot2 without horizontal gridlines and Y-axes labels in R?
- How to draw a circle in R?
- How to create a dotchart using ggplot2 without gridlines in R?
- How to draw a violin plot in R?
- How to convert ggplot2 graph into a plotly graph in R?
- How to define points outside the R data frame and draw them in ggplot2 graph?
- How to create gridlines that matches with Y-axis values in the plot created by using plot function in R?
- How to draw a rectangle over a specific region in a Matplotlib graph?
- How to plot a function with ggplot2 in R?
- How to draw grid lines behind Matplotlib bar graph?
- How to create a horizontal line in ggplot2 graph with larger width in R?
- How to create a horizontal line in ggplot2 graph with different color in R?
- How to create a function in R with two inputs?
- How to draw a line using imageline() function in PHP?

Advertisements