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

Need to skip "bad" values during scale transformation #301

Closed
ASmirnov-HORIS opened this issue Jan 27, 2021 · 0 comments
Closed

Need to skip "bad" values during scale transformation #301

ASmirnov-HORIS opened this issue Jan 27, 2021 · 0 comments
Assignees

Comments

@ASmirnov-HORIS
Copy link
Collaborator

The following code produces an exception ends can't be None:

import numpy as np

from lets_plot import *
LetsPlot.setup_html()

np.random.seed(42)

n = 1000
x = np.linspace(-10, 10, n)
y = x ** 2 + np.random.normal(size=n)
z = 2.0 ** x + np.random.normal(size=n)
data = {'x': x, 'y': y, 'z': z}

ggplot(data, aes(x='x', y='y')) + \
    geom_point(aes(color='z')) + \
    scale_y_log10() + scale_color_gradient(low='red', high='green', trans='log10')

Without trans parameter I have this:

It would be better if the color were transformed logarithmically but there are a few bad values in the data (with negative z). The exception message doesn't explain what exactly goes wrong and what I should do with my data. Also I want to keep my data immutable, so I prefer to have some parameter for skipping non-colorable data - then "bad" points would be colored gray or something.

@alshan alshan added this to the 2021Q2 milestone Mar 26, 2021
@alshan alshan modified the milestones: 2021Q2, 2021Q3 Jun 28, 2021
@alshan alshan self-assigned this Jul 2, 2021
@alshan alshan closed this as completed Jul 8, 2021
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