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_width (float) – Bin width.

  • jitter_width (float) – Jittering width.

  • jitter_height (float) – Jittering height.

Returns

Geom object position specification.

Return type

FeatureSpec

Note

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())