Show Sidebar Hide Sidebar

Dot Plots in R

How to make a dot plot in R. Dot plots show changes between two points in time or between two conditions.

New to Plotly?

Plotly's R library is free and open source!
Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode.
We also have a quick-reference cheatsheet (new!) to help you get started!

Version Check

Version 4 of Plotly's R package is now available!
Check out this post for more information on breaking changes and new features available in this version.

## [1] '4.9.1'

Dot and Dumbbell Plots

s <- read.csv("")
s <- s[order(s$Men), ]

p <- plot_ly(s, x = ~Women, y = ~School, name = "Women", type = 'scatter',
             mode = "markers", marker = list(color = "pink")) %>%
  add_trace(x = ~Men, y = ~School, name = "Men",type = 'scatter',
            mode = "markers", marker = list(color = "blue")) %>%
    title = "Gender earnings disparity",
    xaxis = list(title = "Annual Salary (in thousands)"),
    margin = list(l = 100)



See for more information and chart attribute options!