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

[query/ggplot] fixes math for continuous color scales #13609

Merged
merged 1 commit into from Sep 13, 2023

Conversation

iris-garden
Copy link
Collaborator

CHANGELOG: Fixed a bug in hail.ggplot.scale_color_continuous that sometimes caused errors by generating invalid colors.

For example, this code:

import hail as hl
from hail.ggplot import ggplot, aes, geom_point
t = hl.utils.range_table(10)
t = t.annotate(x=hl.rand_unif(), y=hl.rand_unif(), z=hl.rand_unif(1, 10))
fig = ggplot(t, aes(x=t.x, y=t.y, color=t.z)) + geom_point()
fig.show()

Produces an error like this:

ValueError:
    Invalid element(s) received for the 'color' property of scatter.marker
        Invalid elements include: ['rgb(-84, -187, 123)', 'rgb(-116, -227, 131)', 'rgb(-29, -120, 109)', 'rgb(-33, -125, 110)', 'rgb(15, -65, 97)', 'rgb(10, -71, 99)', 'rgb(-112, -223, 130)', 'rgb(-63, -162, 117)', 'rgb(-81, -185, 122)', 'rgb(31, -45, 93)']

But after this change is applied, it produces a plot like this:

newplot(2)

@danking danking merged commit bdf055e into hail-is:main Sep 13, 2023
8 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants