Skip to content

Instantly share code, notes, and snippets.

@chtzvt
Last active August 28, 2016 17:34
Show Gist options
  • Save chtzvt/c7ac4cb2e9ee5b26b3476d59ced9888e to your computer and use it in GitHub Desktop.
Save chtzvt/c7ac4cb2e9ee5b26b3476d59ced9888e to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
xax = np.array([1.7,7.7,18.8,27.2,34.5,37.5,37.8,38.1,36.8,35.7,34.9])
yax = np.array(["0-9","10-19","20-29","30-39","40-49","50-59","60-69","70-79","80-89","90-99","100-109"])
values, base = np.histogram(xax, bins=10)
cum = np.cumsum(values)
yax_arrange = y_axis = np.arange(1, len(yax) + 1, 1)
xax_arrange = x_axis = np.arange(xax.min(), xax.max(), 3)
plt.yticks(yax_arrange, yax)
plt.xticks(xax_arrange, xax)
plt.plot(base[:-1], cum, c='blue')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment