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

extent parameter in `transform_regression not working as expected #3347

Closed
thomascamminady opened this issue Mar 1, 2024 · 2 comments
Closed
Labels

Comments

@thomascamminady
Copy link
Contributor

I took this example from the gallary

import altair as alt
import pandas as pd
import numpy as np

np.random.seed(42)
x = np.linspace(0, 10)
y = x - 5 + np.random.randn(len(x))

df = pd.DataFrame({'x': x, 'y': y})

chart = alt.Chart(df).mark_point().encode(
    x='x',
    y='y'
)

chart + chart.transform_regression('x', 'y').mark_line()

and got this plot
image

So far, so good. But when I add the extent parameter like such

chart + chart.transform_regression('x', 'y',extent=[0,20]).mark_line()

The plot is wrong:
image

@jonmmease
Copy link
Contributor

Hi @thomascamminady, unfortunately this is an upstream bug in Vega-Lite (reported in vega/vega-lite#9230) that hasn't been investigated yet. Going to close here as we won't be able to address it in Vega-Altair.

I added a comment with some observations in vega/vega-lite#9230 (comment)

@thomascamminady
Copy link
Contributor Author

Thanks for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants