Last active
October 11, 2015 15:38
-
-
Save adunsmoor/3881296 to your computer and use it in GitHub Desktop.
Quick and dirty histogram using Matplotlib
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
# Quick and dirty histogram using Matplotlib | |
# Reads a file full of numbers and creates a histogram. | |
import sys | |
import matplotlib.pyplot as plt | |
for file in sys.argv[1:]: | |
with open(file) as f: | |
values = [float(x) for x in f] | |
plt.hist(values, bins=100, log=True, label=file) | |
plt.xlabel('Values') | |
plt.ylabel('Frequency') | |
if len(sys.argv) > 1: plt.legend() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment