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

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

Open IKupriyanov-HORIS opened this issue 1 year ago • 0 comments

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

IKupriyanov-HORIS avatar Jul 22 '24 19:07 IKupriyanov-HORIS