geom_bar with stat='identity' does not stack values when only one group present

Open
#1,398 4 comments 0 reactions 1 assignee View on GitHub

@ASmirnov-HORIS is already working on this.

Since Sep 25, 2025.

Assessment

This issue has not been assessed yet.

Description

d = {
    'name': ['foo', 'foo', 'bar', 'bar'],
    'g': ['A', 'B', 'A', 'B'],
    'value': [80, 90, 15, 35]
}

ggplot(d) + geom_bar(aes(x='name', y='value', group='name'), stat='identity')

Actual result:
Image

When values are assigned to their own group, everything works as expected (note the mapping group='g'):

Image
Dominant language
Kotlin
Stars
1.8k
Forks
63
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JetBrains/lets-plot

All issues in JetBrains/lets-plot

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.