Skip to content

Instantly share code, notes, and snippets.

@dmarcelinobr
Last active August 29, 2015 14:00
Show Gist options
  • Save dmarcelinobr/11356623 to your computer and use it in GitHub Desktop.
Save dmarcelinobr/11356623 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pylab as plt
from scipy import stats
# For the last presidential elections
coalition = ['PT','PSDB','PSTU','PSB','PCO','PPS','PCO','PSL', 'PSDC','PRP','PT','PSDB','PDT', 'PSOL','PT','PSDB','PV','PSOL','PSDC','PCB','PRTB','PCO','PSTU']
year = [2002,2002,2002,2002,2002,2002,2006,2006,2006,2006,2006,2006,2006,2006,2010,2010,2010,2010,2010,2010, 2010,2010,2010]
timeinsec =[312,623,83,133, 83, 257,71,75,75,71,437,613,243,71,639,438,83,62,56,56,56,56,56]
votes = [46.44,23.19,0.47,17.86,0.04,11.97,0,0.06,0.07,0.13, 48.61,41.64,2.64,6.85,46.91,32.61,19.33,0.87, 0.09,0.08,0.06,0.04,0.01]
size = 2*votes
plt.scatter(timeinsec,votes,
marker='o',
edgecolor='black',
facecolor='red',
alpha=0.5,
s=size)
plt.xlabel('Time share in seconds')
plt.ylabel('Vote share')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment