lets_plot.position_fill

lets_plot.position_fill(vjust=None)

Adjust position by stacking overlapping objects on top of each other and standardise each stack to have constant height.

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 and standardise each stack to have constant height.

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', position = 'fill') + \
10    geom_text(aes(label = 'y'), position = position_fill(0.5))