The alpha aes in geom_line is not reflecting back in legend symbol

Open
#1,512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
57/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
kotlin, python

Research direction

The report reproduces the legend alpha mismatch for geom_line, geom_path, and geom_lollipop in lets-plot 4.11.0, while geom_point and bar geoms work. Start by tracing how line and lollipop legend symbols are rendered and compare their alpha handling with the working point legend. Done when the legend symbols reflect the mapped alpha consistently with the plotted geoms; the issue names no source files or tests.

Written by the indexing model from the issue text.

Description

I am using python lets-plot on version 4.11.0.

When using an alpha aes on a line geom (i only tested line, path, lollipop), the alpha is not reflecting back in the legend symbols. So they are all alpha=1. For the lollipop, the circle does show the alpha, while the line doesn't.

Using geom_point, _bar..., the alpha does work fine in the legend.

n = 100
x = np.linspace(-4 * np.pi, 4 * np.pi, n)
y = np.sin(x)
c = np.repeat(['a', 'b'], n//2)

gggrid(
    [
        ggplot({'x': x, 'y': y, 'c':c}, aes(x='x', y='y', alpha='c')) + geom_line(),
        ggplot({'x': x, 'y': y, 'c':c}, aes(x='x', y='y', alpha='c')) + geom_lollipop(),
        ggplot({'x': x, 'y': y, 'c':c}, aes(x='x', y='y', alpha='c')) + geom_point(),
    ]
)
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.