JetBrains / lets-plot

Multiplatform plotting library based on the Grammar of Graphics
https://lets-plot.org
MIT License
1.54k stars 49 forks source link

Allow geom_bar() as a marginal layer #972

Open ASmirnov-HORIS opened 8 months ago

ASmirnov-HORIS commented 8 months ago

Example:

data = {
    'x': ["a", "a", "b", "b"],
    'y': ["f", "g", "g", "g"],
}
ggplot(data, aes('x', 'y')) + \
    geom_count() + \
    ggmarginal('r', layer=geom_bar())

Output:

Internal error: IllegalStateException : Not a collections of Double(s)

Can be fixed by adding orientation='y' into the geom_bar().

It seems that the ability to add discrete geoms as marginal layers was overlooked, but with the introduction of geom_count() it makes sense.

alshan commented 8 months ago

Maybe related to #600