Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asDiscrete: the levels parameter works inconsistently with values of int type #252

Open
IKupriyanov-HORIS opened this issue Jul 19, 2024 · 0 comments
Milestone

Comments

@IKupriyanov-HORIS
Copy link
Collaborator

In the legend, I expect the order 3, 2, 1 (reversed, order=-1) for levels=1, 2, 3. The actual order is 2, 1, 3, which looks like the reversed data order, i.e., the levels parameter is ignored:

%useLatestDescriptors
%use lets-plot

val d = mapOf(
    "x" to listOf(0, 1, 2),
    "v" to listOf(3, 1, 2),
)

ggplot(d) + geomPoint { 
    x = "x"; 
    color = asDiscrete("v", levels=listOf(1, 2, 3), order=-1)
}

image

Without order=-1, the int levels are handled properly:
image

With doubles, the levels parameters handled properly even with the order parameter:
image

Version:

Lets-Plot Kotlin API v.4.7.3. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.3.3.
@alshan alshan added this to the 2024Q3 milestone Jul 26, 2024
@alshan alshan modified the milestones: 2024Q3, 2024Q4 Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants