** dotchart()** function in R Language is used to create a dot chart of the specified data. A dot chart is defined as a plot which is used to draw a Cleveland dot plot.

Syntax:

dotchart(x, labels = NULL, groups = NULL,

gcolor = par(“fg”),

color = par(“fg”))

Parameters:

x:it is defined as numeric vector or matrix

labels:a vector of labels for each point.

groups:a grouping variable indicating how the elements of x are grouped.

gcolor:color to be used for group labels and values.

color:the color(s) to be used for points and labels.

**Example 1:**

`# Dot chart of a single numeric vector ` `dotchart` `(mtcars$mpg, labels = ` `row.names` `(mtcars), ` ` ` `cex = 0.9, xlab = ` `"mpg"` `) ` |

*chevron_right*

*filter_none*

**Example 2:**

`# Plot and color by groups cyl ` `grps <- ` `as.factor` `(mtcars$cyl) ` `my_cols <- ` `c` `(` `"blue"` `, ` `"darkgreen"` `, ` `"orange"` `) ` `dotchart` `(mtcars$mpg, labels = ` `row.names` `(mtcars), ` ` ` `groups = grps, gcolor = my_cols, ` ` ` `color = my_cols[grps], ` ` ` `cex = 0.9, pch = 22, xlab = ` `"mpg"` `) ` |

*chevron_right*

*filter_none*

## Recommended Posts:

- Dot Product of Vectors in R Programming
- Adding Colors to Charts in R Programming
- R - Bar Charts
- R - Pie Charts
- R - Charts and Graphs
- Create an Object of mode call in R Programming - call() Function
- Create Repetitions of a String in R Programming - strrep() Function
- Create a Data Frame of all the Combinations of Vectors passed as Argument in R Programming - expand.grid() Function
- Create Line Curves for Specified Equations in R Programming - curve() Function
- Create Subsets of a Data frame in R Programming - subset() Function
- Create Quantiles of a Data Set in R Programming - quantile() Function
- Create a Random Sequence of Numbers within t-Distribution in R Programming - rt() Function
- Create a Tabular representation of Data in R Programming - table() Function
- Create an Expression in R Programming - expression() Function
- Create Random Deviates of Uniform Distribution in R Programming - runif() Function
- Create a Range of Colors between the Specified Colors in R Programming - colorRampPalette() Function
- Create a Plot Matrix of Scatterplots in R Programming - pairs() Function
- Create a Vector of Colors from a Vector of Gray Levels in R Programming - gray() or grey() Function
- Create a Vector of Colors with specified Hue, Chroma and Luminance in R Programming - hcl() Function
- Create a Vector of Colors with specified Hue, Saturation and Value in R Programming - hsv() Function

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.