lets-plot
lets-plot copied to clipboard
Density/area geom: preserve the z-order when grouping.
Currently, lines are drawn on top of all filled areas.
import numpy as np
from lets_plot import *
LetsPlot.setup_html()
np.random.seed(12)
data = dict(
cond=np.repeat(['A','B'], 200),
rating=np.concatenate((np.random.normal(0, 1, 200), np.random.normal(1, 1.5, 200)))
)
ggplot(data, aes(x='rating', fill='cond')) + ggsize(500, 250) \
+ geom_density(color='black', size=4, alpha=1) + scale_fill_brewer(type='seq')
Expected: In the example, the group 'A' line should be partially obscured by the group 'B' area.