Word Cloud

Coffee Culture Cloud

Coffee and cafe culture vocabulary

Output
Coffee Culture Cloud
Python
import matplotlib.pyplot as plt
from wordcloud import WordCloud

text = """Coffee Espresso Latte Cappuccino Americano Flat White Macchiato
Barista Cafe Coffee Shop Third Wave Specialty Single Origin Blend
Roast Light Medium Dark French Italian Profile Flavor Notes Cupping
Brewing Pour Over Chemex V60 Aeropress French Press Moka Cold Brew
Beans Arabica Robusta Ethiopia Colombia Brazil Guatemala Kenya Yemen
Grinder Burr Blade Fresh Ground Extraction Time Temperature Ratio
Milk Foam Art Latte Art Oat Almond Soy Alternative Dairy Free Sweet"""

def coffee_brown(word, font_size, position, orientation, random_state=None, **kwargs):
    colors = ['#78350f', '#92400e', '#a16207', '#b45309', '#713f12']
    return colors[hash(word) % len(colors)]

wordcloud = WordCloud(
    width=1200, height=600,
    background_color='#fffbeb',
    color_func=coffee_brown,
    max_words=75,
    max_font_size=130,
    min_font_size=10,
    relative_scaling=0.5
).generate(text)

fig, ax = plt.subplots(figsize=(12, 6), facecolor='#fffbeb')
ax.imshow(wordcloud, interpolation='bilinear')
ax.axis('off')
plt.tight_layout(pad=0)
plt.show()
Library

Matplotlib

Category

Text Visualization

Did this help you?

Support PyLucid to keep it free & growing

Support