lets_plot.position_stack

lets_plot.position_stack(vjust=None)

Adjust position by stacking overlapping objects on top of each other.

Parameters
vjustfloat

Vertical adjustment for geoms that have a position (like points or lines), not a dimension (like bars or areas). Set to 0 to align with the bottom, 0.5 for the middle, and 1 for the top.

Returns
FeatureSpec

Geom object position specification.

Notes

Adjust position by stacking overlapping objects on top of each other.

Examples

 1from lets_plot import *
 2LetsPlot.setup_html()
 3data = {
 4    'x': [1, 1, 2, 2],
 5    'y' : [1, 3, 2, 1],
 6    'grp': ["a", "b", "a", "b"]
 7}
 8ggplot(data, aes('x', 'y', group = 'grp')) + \
 9    geom_bar(aes(fill = 'grp'), stat = 'identity') + \
10    geom_text(aes(label = 'y'), position = position_stack(0.5))