Jumat, 14 Juni 2013

Tugas Probabilitas dan Statistika

nama : fahreza abi hakim
npm : 1215031028
kelas : B
sumber
http://regionalinvestment.bkpm.go.id/newsipid/id/demografipendudukjkel.php?ia=18&is=37

GRAFIK















SINTAX

import numpy as np
import matplotlib.pyplot as plt

N = 5
Means = (3749739,3769474,3850827,3916622,4767712)

ind = np.arange(N)
width = 0.7

plt.subplot(111)
rects1 = plt.bar(ind, Means, width, color='red')

plt.ylabel('jumlah')
plt.title('jumlah penduduk pria pada tahun 2007-2011')
plt.xticks(ind+width, ( '2007', '2008', '2009', '2010', '2011'))

def autolabel(rects):
    for rect in rects:
        height = rect.get_height()
        plt.text(rect.get_x()+rect.get_width()-0.7 , 1*height, '%d'%int(height),
                 ha='left', va='bottom')

autolabel(rects1)
       
plt.show()