Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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