R Dot Plots

Dot plot is a statical chart consisting of data points plotted on a simple scale. It is generally used for small to moderate size data set. In R, we can generate dot plots using dotchart() function.

Syntax of Dot Chart

dotchart(data, col, pch, main)

data - data is the data to plot on a graph.
col - the col attribute is used to set the color.
main - the main attribute is to give a title to the graph.
pch - pch specify a particular type of symbol.

There are twenty five plotting symbols are available in pch.


Example of R Dot Plots

In the below example, we generate dotplot of student marks.

students <- c(10,11,12,15,14,10,16,17,12)
dotchart(students, col = 'red')

The above code generates this graph.

R Dot Plots





Read more articles


General Knowledge



Learn Popular Language