Created
July 9, 2021 21:23
-
-
Save Padhma/4bb20413ee43d7dc610148fcfeffe440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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