首页 > 解决方案 > 绘制直方图标签

问题描述

知道如何在我的绘图直方图上写直接标签吗?我会导出它们,所以我需要写下标签。

fig = go.Figure(data=[
            go.Histogram(name='Green', x=df['ACTION'], y=df['1'],text=df['1'],histfunc='sum'),
            go.Histogram(name='orange', x=df['ACTION'], y=df['2'],text="test",histfunc='avg'),
            go.Histogram(name='blue', x=df['ACTION'], y=df['3'],text="test",histfunc='avg')
        ])

texposition 适用于条形图,但不适用于直方图。我需要直方图的平均功能。

Invalid property specified for object of type plotly.graph_objs.Histogram: 'textposition'

标签: plotly

解决方案


我目前正在寻找直方图上的文本属性,但它似乎没有实现,我认为如果文本没有实现,textposition 也不会


推荐阅读