lets-plot icon indicating copy to clipboard operation
lets-plot copied to clipboard

Density/area geom: preserve the z-order when grouping.

Open alshan opened this issue 2 years ago • 0 comments

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

image


Expected: In the example, the group 'A' line should be partially obscured by the group 'B' area.

alshan avatar Jun 28 '22 20:06 alshan