# Plotly.express area multiple plot error

**URL:** https://community.plotly.com/t/plotly-express-area-multiple-plot-error/59739
**Category:** 📊 Plotly Python
**Created:** [January 3, 2022, 4:10pm UTC](https://community.plotly.com/t/plotly-express-area-multiple-plot-error/59739 "2022-01-03T16:10:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Bijan](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/bijan/32/22061_2.png) [@Bijan](https://community.plotly.com/u/Bijan)
#### Post date: [January 3, 2022, 4:10pm UTC](https://community.plotly.com/t/plotly-express-area-multiple-plot-error/59739/1 "2022-01-03T16:10:30Z")

</div>

Hi all

This is my code:

```auto
import pandas as pd
import plotly.express as px
df={'x':[1,2,3,4,5],'y1':[1,2,3,4,5],'y2':[2,3,4,5,6],'y3':[3,4,5,6,7]}
df=pd.DataFrame(df)
fig = px.area(df, x="x", y=['y1','y2','y3'])
fig.show()

```

As you can see my Y data are maximum 7. Why the results in the figure shows wrong values? why the vertical axis (value) do not show the correct values that are defined in above dictionary???

 ![newplot](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/0/7/07e80045c4bf8f96001df48f249a0c78bff52e68.png)

---

<div class="post-metadata">

### Author: ![Bijan](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/bijan/32/22061_2.png) [@Bijan](https://community.plotly.com/u/Bijan)
#### Post date: [January 3, 2022, 5:52pm UTC](https://community.plotly.com/t/plotly-express-area-multiple-plot-error/59739/2 "2022-01-03T17:52:28Z")

</div>

As I understood, ( [pandas - Plotly.express Area multiple plots data error - Stack Overflow](https://stackoverflow.com/questions/70568401/plotly-express-area-multiple-plots-data-error))  
`plotly.express.area`  
creates a stacked area plot, [where each filled area corresponds to one column of the input data:](https://plotly.com/python/filled-area-plots/)

For example, at `x = 5` , the stacked area plot reaches `y = 18 = 5 + 6 + 7` .

Now the question is that What if I need to fill the area under the function like `express.area` whitout above problem ?

---

<div class="post-metadata">

### Author: ![alooksha](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@alooksha](https://community.plotly.com/u/alooksha)
#### Post date: [January 3, 2022, 7:14pm UTC](https://community.plotly.com/t/plotly-express-area-multiple-plot-error/59739/3 "2022-01-03T19:14:00Z")

</div>

@Bijan, you can do it this way

```auto
df={'x':[1,2,3,4,5],'y1':[1,2,3,4,5],'y2':[2,3,4,5,6],'y3':[3,4,5,6,7]}
df=pd.DataFrame(df)
fig = go.Figure() 
fig.add_scatter(x = df['x'], y=df['y1'], mode='lines',fill='tozeroy', fillcolor='red') 
fig.add_scatter(x = df['x'], y=df['y2'], mode='lines', fill='tonexty',fillcolor='green') 
fig.add_scatter(x = df['x'], y=df['y3'], mode='lines',fill='tonexty',fillcolor='blue') 

fig.show()

```

---

<div class="post-metadata">

### Author: ![Bijan](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/bijan/32/22061_2.png) [@Bijan](https://community.plotly.com/u/Bijan)
#### Post date: [January 3, 2022, 8:49pm UTC](https://community.plotly.com/t/plotly-express-area-multiple-plot-error/59739/4 "2022-01-03T20:49:15Z")

</div>

Thanks @alooksha. That’s the answer 👍
