[英]Stacked Bar Plot in Seaborn with groups
I would like to create a stacked bar chart showing for each Day_Since_Acquisition
the number of Total_Customers
for each Aquisition_Channel
.我想创建一个堆积条形图,显示每个
Day_Since_Acquisition
每个Aquisition_Channel
的Total_Customers
数量。
I am having issues creating a stacked bar plot out of this df that show on the X-axis on the values for Day_Since_Acquisition
and nothing in between.我在创建堆积条形图 plot 时遇到问题,该条形图显示在 X 轴上
Day_Since_Acquisition
值的 X 轴上,两者之间没有任何内容。
DF东风
Aquisition_Channel Day_Since_Acquisition Total_Customers
Digital 7 10
Digital 14 12
Digital 21 16
Digital 28 20
Organic 7 32
Organic 14 40
Organic 21 41
Organic 28 45
Offline 7 23
Offline 14 30
Offline 21 46
Offline 28 55
This is my current code:这是我当前的代码:
fig = px.bar(df, x="Day_Since_Acquisition", y="Total_Customers",
color="Day_Since_Acquisition", barmode = 'stack')
fig.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.