lets_plot.geom_dotplot(mapping=None, *, data=None, stat=None, show_legend=None, sampling=None, tooltips=None, binwidth=None, bins=None, method=None, stackdir=None, stackratio=None, dotsize=None, stackgroups=None, center=None, boundary=None, **other_args)

Dotplot represents individual observations in a batch of data with circular dots. The diameter of a dot corresponds to the maximum width or bin width, depending on the binning algorithm.


Set of aesthetic mappings created by aes() function. Aesthetic mappings describe the way that variables in the data are mapped to plot “aesthetics”.

datadict or DataFrame or polars.DataFrame

The data to be displayed in this layer. If None, the default, the data is inherited from the plot data as specified in the call to ggplot.

statstr, default=’dotplot’

The statistical transformation to use on the data for this layer, as a string. Supported transformations: ‘identity’ (leaves the data unchanged), ‘dotplot’ (depends on method parameter).

show_legendbool, default=True

False - do not show legend for this layer.


Result of the call to the sampling_xxx() function. Value None (or ‘none’) will disable sampling for this layer.


Result of the call to the layer_tooltips() function. Specifies appearance, style and content.


When method is ‘dotdensity’, this specifies maximum bin width. When method is ‘histodot’, this specifies bin width.

binsint, default=30

When method is ‘histodot’, this specifies number of bins. Overridden by binwidth.

method{‘dotdensity’, ‘histodot’}, default=’dotdensity’

Use ‘dotdensity’ for dot-density binning, or ‘histodot’ for fixed bin widths (like in geom_histogram).

stackdir{‘up’, ‘down’, ‘center’, ‘centerwhole’}, default=’up’

Which direction to stack the dots.

stackratiofloat, default=1.0

How close to stack the dots. Use smaller values for closer, overlapping dots.

dotsizefloat, default=1.0

The diameter of the dots relative to binwidth.

stackgroupsbool, default=False

Stacks dots across groups when method=’histodot’.


When method is ‘histodot’, this specifies x-value to align bin centers to.


When method is ‘histodot’, this specifies x-value to align bin boundary (i.e. point between bins) to.


Other arguments passed on to the layer. These are often aesthetics settings used to set an aesthetic to a fixed value, like color=’red’, fill=’blue’, size=3 or shape=21. They may also be parameters to the paired geom/stat.


Geom object specification.


With ‘dotdensity’ binning, the bin positions are determined by the data and binwidth, which is the maximum width of each bin. With ‘histodot’ binning, the bins have fixed positions and fixed widths, much like a histogram.

Computed variables:

  • ..count.. : number of points with x-axis coordinate in the same bin.

  • ..binwidth.. : max width of each bin if method is ‘dotdensity’; width of each bin if method is ‘histodot’.

geom_dotplot() understands the following aesthetics mappings:

  • x : x-axis value.

  • alpha : transparency level of a layer. Understands numbers between 0 and 1.

  • color (colour) : color of a geometry lines. Can be continuous or discrete. For continuous value this will be a color gradient between two colors.

  • fill : color of geometry filling.


1import numpy as np
2from lets_plot import *
5data = {'x': np.random.normal(size=100)}
6ggplot(data, aes(x='x')) + geom_dotplot()