Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@davisvictorns
Created September 15, 2021 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davisvictorns/d8160d60835078c035fc424f60a673b2 to your computer and use it in GitHub Desktop.
Save davisvictorns/d8160d60835078c035fc424f60a673b2 to your computer and use it in GitHub Desktop.
# degree sequence
count_sequence = sorted([data['count'] for node, data in list(G.nodes.data())], reverse=True)[1:]
fig, ax = plt.subplots(1,2,figsize=(8,4))
# all_data has information about count_sequence and the width of each bin
ax[0].hist(count_sequence)
ax[1].hist(count_sequence,bins=[x for x in range(80)])
ax[0].set_title("count Histogram")
ax[0].set_ylabel("Count")
ax[0].set_xlabel("n tweets")
ax[0].set_ylim(0, max(count_sequence))
ax[1].set_title("count Histogram - Zoom")
ax[1].set_ylabel("Count")
ax[1].set_xlabel("n tweets")
ax[1].set_xlim(0, 80)
ax[1].set_ylim(0,150)
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment