Skip to content

Instantly share code, notes, and snippets.

@brenoimatos
Created January 7, 2021 21:09
Show Gist options
  • Save brenoimatos/d23667179dc5b397e948cfb197eb8a4a to your computer and use it in GitHub Desktop.
Save brenoimatos/d23667179dc5b397e948cfb197eb8a4a to your computer and use it in GitHub Desktop.
# função adjust_text importada de https://github.com/Phlya/adjustText/blob/master/adjustText/__init__.py
x = df['Unique']
y = df['Relative']
annot = df.index
fig, ax = plt.subplots(figsize=(12, 15))
ax.scatter(x, y)
texts = []
for i, txt in enumerate(annot):
texts.append(ax.text(x[i], y[i], txt))
adjust_text(texts)
plt.xlabel("#Palavras Únicas")
plt.ylabel("Relação #Palavras Únicas/#Palavras Totais")
ax.yaxis.set_major_formatter(mtick.PercentFormatter(1))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment