Skip to content

Instantly share code, notes, and snippets.

@jgcasta
Last active December 12, 2015 09:09
Show Gist options
  • Save jgcasta/4749380 to your computer and use it in GitHub Desktop.
Save jgcasta/4749380 to your computer and use it in GitHub Desktop.
Plot histogram data
#! /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