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

Area chart with gradient #591

Open
jrr96 opened this issue May 19, 2022 · 3 comments
Open

Area chart with gradient #591

jrr96 opened this issue May 19, 2022 · 3 comments
Labels

Comments

@jrr96
Copy link

jrr96 commented May 19, 2022

Is there any way to achieve a gradient in the filling of an area chart?

Capture

I have not been able to find anything in the docs.

If not, how feasible would it be to add this feature? I think it greatly improves the aesthetics of area charts.

Thanks a lot in advance!

@has2k1
Copy link
Owner

has2k1 commented May 19, 2022

It is not possible, and I do not know if it can be implemented cleanly (without trying).

@has2k1 has2k1 added the Feature label May 19, 2022
@jrr96
Copy link
Author

jrr96 commented Sep 6, 2022

If I am understanding the philosophy, the code should look something like this right?

(
ggplot(df, aes(x='date', y='value', alpha='value'))
+ scale_alpha(range=(0, 1))
+ geom_area()
)

@has2k1
Copy link
Owner

has2k1 commented Sep 7, 2022

If I am understanding the philosophy, the code should look something like this right?

(
ggplot(df, aes(x='date', y='value', alpha='value'))
+ scale_alpha(range=(0, 1))
+ geom_area()
)

Maybe or maybe not only that. The gradient may come from the alpha or from the fill (the continuous colour range) or even both. The key to implementing though, is that it should be supported by the underlying drawing system; that is the hard part!

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