<jupyter_start><jupyter_text>Basic Histogram<jupyter_code>x = np.random.randn(500)
data = [go.Histogram(
    x=x,
    # 是否进行标准化
    histnorm='probability',
    # 是否进行累计显示
    cumulative=dict(enabled=False),
)]
layout = go.Layout(
    title='Sampled Results',
    xaxis=dict(title='Value'),
    yaxis=dict(title='Count'),
    bargap=0.2,
)
fig = go.Figure(data=data, layout=layout)
plotly.offline.iplot(fig, filename='basic histogram')<jupyter_output><empty_output><jupyter_text>Basic Distplot<jupyter_code>x1 = np.random.randn(200)-2  
x2 = np.random.randn(200)  
x3 = np.random.randn(200)+2  
x4 = np.random.randn(200)+4  
colors = ['#A56CC1', '#A6ACEC', '#63F5EF', '#43AB32']

hist_data = [x1, x2, x3, x4]
group_labels = ['Group 1', 'Group 2', 'Group 3', 'Group 4']

fig = ff.create_distplot(
    hist_data, group_labels, 
    bin_size=.2, 
    colors=colors,
    # 设置显示什么
    show_hist=True, 
    show_curve=True, 
    show_rug=True)
plotly.offline.iplot(fig)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16532258064516128, 'fraction_numerical': 0.04435483870967742, 'mean_word_length': 4.610169491525424, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '77692', 'license': 'MIT', 'n_tokens_mistral': 451, 'n_tokens_neox': 432, 'n_words': 61, 'path': 'PythonPracticalCases/Plotly/histogram&distplot.ipynb', 'repo_name': 'BigTear/WebRoad', 'size': '992'}