Created
October 1, 2012 06:44
-
-
Save imrehg/3809909 to your computer and use it in GitHub Desktop.
Plotting lots of histograms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pylab as plt | |
import string | |
import random | |
## Just generate some data | |
sets, items = 500, 200 # number of symbols, number of datapoints for each symbol | |
dataset = np.random.random((sets, items)) - 0.5 | |
up = string.ascii_uppercase | |
n = len(up) | |
symbols = ["".join([up[(i/n) % n], up[i % n]]) for i in range(sets)] | |
### | |
for i in range(len(symbols)): | |
plt.hist(dataset[i, :], 30, range=[-0.5, 0.5], label=symbols[i]) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment