Skip to content

Instantly share code, notes, and snippets.

@Padhma
Created Jul 9, 2021
Embed
What would you like to do?
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