Skip to content

Instantly share code, notes, and snippets.

@zredlined
Created March 18, 2022 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zredlined/9d34ae832845b6a856cfce5049f93684 to your computer and use it in GitHub Desktop.
Save zredlined/9d34ae832845b6a856cfce5049f93684 to your computer and use it in GitHub Desktop.
import plotly.figure_factory as ff
import numpy as np
# Add histogram data
x1 = np.random.randn(500) - 2
x2 = np.random.randn(500)
x3 = np.random.randn(500) + 2
x4 = np.random.randn(500) + 4
# Group data together
hist_data = [x1, x2, x3, x4]
group_labels = ['Group 1', 'Group 2', 'Group 3', 'Group 4']
# Create distplot with custom bin_size
fig = ff.create_distplot(hist_data, group_labels, bin_size=.2)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment