Skip to content

Instantly share code, notes, and snippets.

@AlexDel
Last active June 20, 2017 09:24
Show Gist options
  • Save AlexDel/cbdf32cf92d9e81f13d855e720e099da to your computer and use it in GitHub Desktop.
Save AlexDel/cbdf32cf92d9e81f13d855e720e099da to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
data = np.random.normal(7.3, 1.43, 20)
d = [x for x in np.ceil(data) if x <= 10]
plt.hist(d, bins=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], range=(1,11), color="red", align="left")
plt.title('Title')
plt.show()
def plotMe(mean, std, color, title):
data = np.random.normal(mean, std, 40)
d = [x for x in np.ceil(data) if x <= 10]
plt.hist(d, bins=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], range=(1,11), color=color, align="left")
plt.title(title)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment