简体   繁体   English

如何获得可绘制的直方图中的垃圾箱数量?

[英]How do I get the number of bins in a plotly histogram?

Suppose I have a plotly histogram, which uses the size parameter and disables autobinx: 假设我有一个绘图直方图,它使用size参数并禁用了自动binx:

import plotly.graph_objs as go

histFig = go.Figure()
histFig.add_trace(go.Histogram(x=data, name='blah'
xbins=dict(
    size=nbins)
    autobinx=False
))

Does go.Histogram have an internal variable that gives me the number of bins that are displayed on this plot? go.Histogram是否有一个内部变量,该变量可为我提供此图上显示的箱数?

No, it doesn't. 不,不是。 The binning calculations happen on render in Javascript. 合并计算在Java渲染中进行。

You can basically do the calculation yourself though: range/size. 不过,您基本上可以自己进行计算:范围/大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM