I want to plot multi layer area plot with gradient.
See original GitHub issueI want to plot multilayer area plot with gradient. But as far I found there is no way to do that without compounding charts. When charts are compounded I need to create a separate legend for the chart. Is there way that I can plot a multilayer area plot with gradient including the legend without compounding. I used below function to plot single layer area chart
chart=alt.Chart(df_melt[df_melt.Legend==clm]).mark_area(line={'color':'blue'},
color=alt.Gradient( gradient='linear',
stops=[alt.GradientStop(color='white', offset=0),
alt.GradientStop(color='blue', offset=1)] ,
x1=1,
x2=1,
y1=1,
y2=0)
).encode(
x='Days',
y='% of Population:Q',
tooltip='% of Population',
opacity=alt.value(.5)).properties(
height=300,
width=730).interactive()
return chart `
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to Create a Gradient Area Chart in Tableau (Kizley ...
The gradient area chart can be used to display any measure over time provided all values are on the same side of the...
Read more >Create a Gradient Plot in Excel - PolicyViz
Learn how to create a gradient chart in Excel using stacked bar/column charts and a scatterplot. An application to a ProPublica story as ......
Read more >A Complete Guide to Area Charts | Tutorial by Chartio
Area charts combine the line chart and bar chart for more specific purposes. Use this guide to learn the best times and ways...
Read more >Is it possible to get color gradients under curve in matplotlib?
His method opens to door to many gradient/blur/drop-shadow effects. For example, to make the lines have an evenly blurred underside, you could use...
Read more >Set the following fill effects in the active chart: Gradient fill
Set the following fill effects in the active chart : Gradient fill: color 1: red and color 2: white, background 1Type: Linear and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, your example chart didn’t have a legend, so I didn’t think you wanted one. You can add a legend by adding a stroke encoding:
It’s possible, with some manual configuration of gradients in each layer. Drawing from https://altair-viz.github.io/gallery/area_chart_gradient.html, you could do something like this: