Last active
December 12, 2015 09:09
-
-
Save jgcasta/4749380 to your computer and use it in GitHub Desktop.
Plot histogram data
This file contains 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
#! /usr/bin/env python | |
# -*- coding: utf-8 | |
""" | |
Plot histogram | |
version 1.0 | |
autor José Gómez Castaño | |
email jgcasta@gmail.com | |
""" | |
import numpy as np | |
import matplotlib.mlab as mlab | |
import matplotlib.pyplot as plt | |
import csv | |
x,y = [],[] | |
num = 0 | |
csv_reader = csv.reader(open('radiancia_poblacion_2006.csv')) | |
for line in csv_reader: | |
x.append(float(line[1])) | |
num = num + 1 | |
plt.hist(x, bins = num, normed=1) | |
plt.xlabel('Values') | |
plt.ylabel('Probability') | |
plt.title(r'Histograma') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment