TUGAS PROBABILITAS DAN STATISTIKA
GRAFIK STATISTIK DENGAN MENGGUNAKAN PYTHON
Oleh
Erwin Deby (1215031026)
KELAS B
Grafik :
Source Code :
import numpy as np
import matplotlib.pyplot as plt
N = 18
Means = (341000, 334600, 330500, 332570, 293663, 375819, 397720, 403712, 396104, 403800, 432221, 554634, 578486, 568081, 522312, 541491, 602404, 612120)
ind = np.arange(N)
width = 0.95
plt.subplot(111)
rects1 = plt.bar(ind, Means, width, color='g')
plt.ylabel('Jumlah (ton)')
plt.title('Produksi Perkebunan Besar menurut Jenis Tanaman, Indonesia (Ton), 1995 - 2012')
plt.xticks(ind+width/2, ('1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012') )
def autolabel(rects):
for rect in rects:
height = rect.get_height()
plt.text(rect.get_x()+rect.get_width()-0.95 , 1.01*height, '%d'%int(height),
ha='left', va='bottom')
autolabel(rects1)
plt.show()
import matplotlib.pyplot as plt
N = 18
Means = (341000, 334600, 330500, 332570, 293663, 375819, 397720, 403712, 396104, 403800, 432221, 554634, 578486, 568081, 522312, 541491, 602404, 612120)
ind = np.arange(N)
width = 0.95
plt.subplot(111)
rects1 = plt.bar(ind, Means, width, color='g')
plt.ylabel('Jumlah (ton)')
plt.title('Produksi Perkebunan Besar menurut Jenis Tanaman, Indonesia (Ton), 1995 - 2012')
plt.xticks(ind+width/2, ('1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012') )
def autolabel(rects):
for rect in rects:
height = rect.get_height()
plt.text(rect.get_x()+rect.get_width()-0.95 , 1.01*height, '%d'%int(height),
ha='left', va='bottom')
autolabel(rects1)
plt.show()
File :
https://docs.google.com/file/d/0BxuK16wi_w6mRS1Kb2gtTGpBRE0/edit?usp=sharing
https://docs.google.com/file/d/0BxuK16wi_w6mRS1Kb2gtTGpBRE0/edit?usp=sharing
Sumber Data :
http://bps.go.id/tab_sub/view.php?kat=3&tabel=1&daftar=1&id_subyek=54¬ab=2