File:Belgian federal election 2014.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 479 × 846 pixels, file size: 148 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
Deutsch: Ergebnisse der Parlamentswahlen in Belgien 2014. Stimmenanteile und Sitzverteilung im Parlament („Kammer“).
English: Results of the Belgian general election, 2014. Distribution of votes and distribution of seats in the parliament ("Kammer").
Date
Source Own work
 
This W3C-unspecified plot was created with Matplotlib.
Author Fjalnes
SVG development
InfoField
 
The source code of this SVG is invalid due to 2 errors.
 
This W3C-invalid chart was created with Inkscape.
 
The file size of this SVG chart may be irrationally large because its text has been converted to paths inhibiting translations.

Source code

[edit]
Matplotlib Source Code in Python:
import numpy as np
from scipy.ndimage import imread
import pylab as pl

names = ['N-VA','PS','MR','CD&V','OVLD','SP-A','CDH','Groen','Ecolo','VB','PTB-GO!','FDF','PP','Sonstige'] 
votes = [20.26,11.67,9.64,11.61,9.78,8.83,4.98,5.32,3.30,3.67,1.97,1.80,1.52,5.65]
seats = [33,23,20,18,14,13,9,6,6,3,2,2,1]
colors = ['#fec44f', '#b30000', '#2b8cbe', '#e06b13', '#0868ac', '#c22c1c', '#ec7014', '#a6d96a', '#1a9850', '#8c510a', '#B30000', '#de007b', '#605e8b', '#b3b3b3']



z = sorted(list(zip(names,votes,colors))[:-1], key = lambda x: x[1],reverse = True)
names2 = [x[0] for x in z] + [names[-1]]
votes2 = [x[1] for x in z] + [votes[-1]]
colors2 = [x[2] for x in z] + [colors[-1]]

fig = pl.figure(1,figsize = (4.446 , 8.092))

artists = pl.barh(range(len(names2),0,-1), votes2)
for bar,color,name,value in zip(artists.get_children(),colors2,names2,votes2):
    bar.set_facecolor(color)
    bar.set_linewidth(0)
    bb = bar.get_bbox()
    x = bb.x1 + 1
    y = bb.y0 #+0.5*(bb.y0-bb.y1)
    pl.text(x,y, '%s\n%0.1f' % (name,value) + '%', fontsize=12)
pl.xticks([])
pl.yticks([])
pl.ylim(0.75,15)
ax = pl.gca()
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines['left'].set_linewidth(3)

pl.savefig('votes.svg')



pl.figure(2)
ax = pl.subplot(1,1,1)
ax.set_aspect(1)
wedges, texts = ax.pie(0.5*np.array(seats)/np.sum(seats), counterclock=False, startangle=180, colors=colors[:-1], wedgeprops = { 'linewidth' : 0 }, labels = ['%s\n%d'%(n,s) for n,s in zip(names[:-1],seats)], labeldistance = 1.2)
for t in texts:
    t.set_horizontalalignment('center')

lw = 2
#draw line around pie
ax.pie([0.5], counterclock=False, startangle=180, colors=['#ffffff'], wedgeprops = { 'linewidth' : lw,'fill':False })
#draw a circle at the center of pie to make it look like a donut
centre_circle = pl.Circle((0,0),0.34,color='black', fc='white',linewidth=lw)
ax.add_artist(centre_circle)
rect = pl.Rectangle((-1,-0.5),2,0.49, facecolor='white', linewidth=0)
#centre_circle.set_clip_path(rect)
ax.add_artist(rect)

pl.savefig('seats.svg')

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current16:22, 29 March 2016Thumbnail for version as of 16:22, 29 March 2016479 × 846 (148 KB)Fjalnes (talk | contribs)Move "Sonstige" to the bottom.
09:22, 28 March 2016Thumbnail for version as of 09:22, 28 March 2016479 × 846 (144 KB)Fjalnes (talk | contribs)Change color for FDF and sort by votes.
12:48, 26 March 2016Thumbnail for version as of 12:48, 26 March 2016514 × 870 (135 KB)Fjalnes (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata