尺寸直方图中的大小参数

时间:2018-11-29 14:54:35

标签: plotly

我正在寻找有关直方图中Size参数的一些文档。以下代码摘自https://plot.ly/python/histograms/

from plotly import tools
import plotly.plotly as py
import plotly.graph_objs as go

x = ['1970-01-01', '1970-01-01', '1970-02-01', '1970-04-01', '1970-01-02', '1972-01-31', '1970-02-13', '1971-04-19']


trace0 = go.Histogram(
    x=x,
    nbinsx = 4,         
  )
trace1 = go.Histogram(
    x=x,
    nbinsx = 8,   
  )
trace2 = go.Histogram(
    x=x,
    nbinsx = 10,     
  )
trace3 = go.Histogram(
    x=x,
    xbins=dict(
        start='1969-11-15',
        end='1972-03-31',
        size= 'M18'),
    autobinx = False
)
trace4 = go.Histogram(
    x=x,
    xbins=dict(
        start='1969-11-15',
        end='1972-03-31',
        size= 'M4'),
    autobinx = False
)
trace5 = go.Histogram(
    x=x,
    xbins=dict(
        start='1969-11-15',
        end='1972-03-31',
        size= 'M2'),
    autobinx = False
)

fig = tools.make_subplots(rows=3, cols=2)
fig.append_trace(trace0, 1, 1)
fig.append_trace(trace1, 1, 2)
fig.append_trace(trace2, 2, 1)
fig.append_trace(trace3, 2, 2)
fig.append_trace(trace4, 3, 1)
fig.append_trace(trace5, 3, 2)

py.iplot(fig, filename='custom binning')

具体地说,size = 'M18', 'M4'等是什么意思?链接到描述此文档的文档将不胜感激!

0 个答案:

没有答案