Skip to content

Instantly share code, notes, and snippets.

@Padhma
Created July 9, 2021 21:23
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 Padhma/4bb20413ee43d7dc610148fcfeffe440 to your computer and use it in GitHub Desktop.
Save Padhma/4bb20413ee43d7dc610148fcfeffe440 to your computer and use it in GitHub Desktop.
from wordcloud import WordCloud, STOPWORDS
from PIL import Image
# create a string with all the topic tags
github_tags = (" ").join(all_tags)
# assign the mask image to a variable
git_mask = np.array(Image.open('../input/wordcloud-mask/github_icon.jpg'))
# instantiate a word cloud object
tags_wc = WordCloud(
mask = git_mask,
background_color='white',
max_font_size=120,
max_words=200,
)
# generate the word cloud
tags_wc.generate(github_tags)
# plot wordcloud and set title
plt.figure(figsize=(6,6),dpi=100)
plt.imshow(tags_wc, interpolation='bilinear')
plt.axis('off')
plt.tight_layout(pad=0)
plt.title('Most common tags used in Github Repositories',fontdict={'size': 15,'color': 'orange','verticalalignment': 'center'})
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment