This page explains how to build a dotplot histogram with R, ggplot2 and plotly. This type of visualization in a specific type of histogram. It shows the distribution of a numeric variable. But instead of using bars, each individual observation is represented as a dot.

It particularly makes sense to use interactivity for dotplot histograms: hovering a datapoint will give you more information about its identity.

The idea is to split our numerical variable in several bins, and to calculate the position on the Y axis for each individual unit. Once this new information is available, it is possible to use the geom_point like if it was a scatterplot.

 

 


Leave a Reply

Be the First to Comment!

avatar
  Subscribe  
Notify of