Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
572 B
2
Indexable
Never
from wordcloud import WordCloud
import matplotlib.pyplot as plt

# Sample text data
text = """
Python is an amazing programming language. 
It is used for data analysis, web development, and machine learning. 
Python's simplicity and readability make it a popular choice among developers.
"""

# Create a word cloud object
wordcloud = WordCloud(width=800, height=400, background_color='white').generate(text)

# Display the word cloud
plt.figure(figsize=(10, 5))
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis('off')  # Hide the axis
plt.show()
Leave a Comment