lets_plot.position_jitterdodge

lets_plot.position_jitterdodge(dodge_width=None, jitter_width=None, jitter_height=None)

This is primarily used for aligning points generated through geom_point() with dodged boxplots (e.g., a geom_boxplot() with a fill aesthetic supplied).

Parameters
dodge_widthfloat

Bin width.

jitter_widthfloat

Jittering width.

jitter_heightfloat

Jittering height.

Returns
FeatureSpec

Geom object position specification.

Notes

Adjust position by dodging overlaps to the side.

Examples

 1import numpy as np
 2from lets_plot import *
 3LetsPlot.setup_html()
 4n = 50
 5np.random.seed(42)
 6x = np.random.uniform(size=n)
 7c = np.random.choice(['a', 'b', 'c'], size=n)
 8ggplot({'x': x, 'c': c}) + \
 9    geom_crossbar(aes(x='c', y='x', color='c'), \
10                  stat='boxplot') + \
11    geom_point(aes(x='c', y='x', color='c'), \
12               size=4, shape=21, fill='white',
13               position=position_jitterdodge())