Jumat, 14 Juni 2013

TUGAS MATA KULIAH PROBABILITAS DAN STATISTIKA 

( Membuat Grafik dengan Menggunakan Bahasa Pemrograman Python )

Nama : Ratih Ningtyas
NPM : 1215031061
Kelas : A

1. Sumber Data 

http://www.bps.go.id/tnmn_pgn.php?kat=3

2. Source Code Program

import numpy as np
import matplotlib.pyplot as plt

alphab = ['2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012']
frequencies = [42.78, 43.11, 43.97, 46.22, 46.88, 47.54, 48.45, 48.19]

pos = np.arange(len(alphab))
width = 0.75
ax = plt.axes()
ax.set_xticks(pos + (width / 2))
ax.set_xticklabels(alphab)

plt.title("Produktivitas Padi Provinsi Lampung Tahun 2005 - 2012")
plt.xlabel("Tahun")
plt.ylabel("Produktivitas (Ku/Ha)")
plt.bar(pos, frequencies, width, color='red')
plt.show()

 3. Tampilan Grafik