position_nudge#
- position_nudge(x=None, y=None)#
Adjust position by nudging a given offset.
- Parameters:
- xfloat
Nudging width.
- yfloat
Nudging 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 = 5 5np.random.seed(42) 6x = np.random.uniform(size=n) 7y = np.random.uniform(size=n) 8t = np.random.choice(list('abcdefghijk'), size=n) 9ggplot({'x': x, 'y': y, 't': t}, aes('x', 'y')) + \ 10 geom_point(size=5, shape=21, color='black', fill='red') + \ 11 geom_text(aes(label='t'), position=position_nudge(y=.05))