JetBrains / JetBrains/lets-plot

as_discrete: the label parameter is ignored if the levels parameter is set

Open
#1,132 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
1.8k
Forks
60
PR merge metrics
No merged PRs in 30d

Description

```python
from lets_plot import *
LetsPlot.setup_html()

d = {
'x': [1, 2],
'y': [0, 0],
'c': [1, 2]
}
ggplot(d, aes(x='x', y='y')) \
+ geom_point(aes(color=as_discrete('c', label="CCC", levels=[2, 1]))) + ggtitle("label='CCC', levels=[2, 1]")
```
Expected - legend title "CCC" with legend rows `2` and `1`

Actual - rows order is `2` and `1`, but title is "c":
![image](https://github.com/user-attachments/assets/2d27deb7-1567-4d89-b871-4669b08658c7)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.