# Plotly 疊加面積圖

## Plotly 堆積面積圖

``````import plotly.graph_objects as go

x = [1, 2, 3, 4]
plot = px.Figure(go.Scatter(name='Data One',x = x,
y = [100, 200, 500, 673],stackgroup='one'))

plot.add_trace(go.Scatter(
name = 'Data Two',
x = x,
y = [56, 123, 982, 213],
stackgroup='one'))

plot.show()
``````

``````import plotly.graph_objects as go

x = [1, 2, 3, 4]
plot = px.Figure(go.Scatter(name='Data One',x = x,
y = [100, 200, 500, 673],stackgroup='one',groupnorm='percent'))

plot.add_trace(go.Scatter(
name = 'Data Two',
x = x,
y = [56, 123, 982, 213],
stackgroup='one'))

plot.show()
``````

``````import plotly.graph_objects as go

x = [1, 2, 3, 4]
data=[go.Scatter(name='Data One',x = x,
y = [100, 200, 500, 673],stackgroup='one'),
go.Scatter(
name = 'Data Two',
x = x,
y = [56, 123, 982, 213],
stackgroup='one')]

plot = px.Figure(data)
plot.show()
``````

Author: Ammar Ali

Hello! I am Ammar Ali, a programmer here to learn from experience, people, and docs, and create interesting and useful programming content. I mostly create content about Python, Matlab, and Microcontrollers like Arduino and PIC.

LinkedIn Facebook

## 相關文章 - Plotly Plot

• Plotly 3D 散點圖
• Plotly 桑基圖
• Plotly 條形圖
• Plotly 樹狀圖
• Plotly 熱圖
• Plotly 甘特圖