绘制:多轴分组条形图 [英] Plotly: Grouped Bar Chart with multiple axes

查看:179
本文介绍了绘制:多轴分组条形图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在trace2 = Bar(...,yaxis='y2')Layout中设置barmode='group'时,这会导致钢筋堆叠或覆盖而不是分组.如何在具有多个轴的同时对这些条进行分组?

When I set barmode='group' in Layout while trace2 = Bar(...,yaxis='y2'), this leads bars to be stacked or overlayed instead of grouping them. How can I group the bars while having multiple axes?

我检查了这些但无济于事:

I went over these but no avail:

  • 在单个Y轴上分组的条形图显示在此处.
  • 还解释了多轴此处,并且提供了y轴参考此处
  • With single Y axis grouped bar chart is shown here.
  • Multiple axes is also explained here and reference for y-axis is available here

推荐答案

对于现在遇到这篇文章的人来说,plotly现在在条形图中具有offsetgroup属性,可以解决此问题.设置barmode='grouped'仍然无效.

For those coming across this post now, plotly now has a offsetgroup attribute in bar graphs that solves this issue. Setting barmode='grouped' still does not work.

这篇关于绘制:多轴分组条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆