Skip to content

Instantly share code, notes, and snippets.

@niftycode niftycode/
Last active Dec 10, 2016

What would you like to do?
Line graph that shows the family status of the citizens of Kiel, Germany
# -*- coding: utf-8 -*-
Line graph of the familiy status of the citizens of Kiel, Germany.
The data is provided by the City of Kiel.
version: 1.3
author: Bodo Schönfeld
last edited: 10/12/2016
import csv
import matplotlib.pyplot as plt
# see
# for more styles'bmh')
with open('kiel_gesetze_justiz_gemeldete_straftaten.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=';')
# create empty lists
jahr = []
ledig = []
verheiratet = []
for row in readCSV:
plt.title("Kiel - Familienstand\n1988-2014 (für 1993 liegt kein Wert vor)")
plt.ylabel("in Tsd.")
plt.plot(jahr, ledig, "r*-", markersize=6, linewidth=1, color='g', label="ledig")
plt.plot(jahr, verheiratet, "r*-", markersize=6, linewidth=1, color='r', label="verheiratet")
plt.legend(loc=(0.25, 0.75))
# plt.savefig('kiel_familienstatus.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.