Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mcobzarenco/5866871 to your computer and use it in GitHub Desktop.
Save mcobzarenco/5866871 to your computer and use it in GitHub Desktop.
Power Law Plotting for Facebook Data
SCALE = 0.1
XMIN = 820
GAMMA = 3.63719
fb_ccdf = ccdf(degs)
xs = array(fb_ccdf[0][500:])
power_law = array(xs / XMIN) ** (-GAMMA + 1) * SCALE
plot(fb_ccdf[0], fb_ccdf[1], label='Facebook')
plot(xs, power_law, label='Power Law: $\gamma = %.4f$' % GAMMA)
xlabel('Degree')
ylabel('CCDF')
xticks(rotation=40)
legend(loc="lower left")
semilogy()
semilogx()
savefig('fig-plfit-fb.pdf', bbox_inches='tight')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment