- import matplotlib.pyplot as plt
- # Define positions for each language family and group
- positions = {
- "Indo-European": (0, 10),
- "Germanic": (-10, 8), "Romance": (0, 8), "Slavonic": (10, 8), "Celtic": (-10, 6), "Indo-Iranian": (0, 6), "Hellenic": (10, 6),
- "West Germanic": (-12, 6), "North Germanic": (-8, 6), "East Slavonic": (8, 6), "West Slavonic": (10, 6), "South Slavonic": (12, 6),
- "English": (-14, 4), "Dutch": (-12, 4), "German": (-10, 4), "Afrikaans": (-13, 2), "Yiddish": (-11, 2), "Frisian": (-9, 2),
- "Swedish": (-8, 4), "Danish": (-6, 4), "Norwegian": (-8, 2), "Icelandic": (-6, 2), "Faroese": (-4, 2),
- "Portuguese": (-2, 6), "Spanish": (0, 6), "Italian": (2, 6), "French": (0, 4), "Romanian": (2, 4),
- "Russian": (6, 4), "Ukrainian": (8, 4), "Belarusian": (10, 4),
- "Polish": (12, 4), "Czech": (14, 4), "Slovak": (16, 4),
- "Bulgarian": (18, 4), "Serbo-Croatian": (20, 4), "Slovenian": (22, 4),
- "Irish": (-10, 4), "Welsh": (-12, 4), "Scottish Gaelic": (-8, 4),
- "Hindi": (0, 4), "Bengali": (2, 4), "Persian": (4, 4),
- "Greek": (10, 4),
- "Sino-Tibetan": (-15, 10), "Chinese": (-18, 8), "Tibetan": (-15, 8), "Burmese": (-12, 8),
- "Mandarin": (-20, 6), "Cantonese": (-16, 6),
- "Austronesian": (15, 10), "Malagasy": (12, 8), "Tagalog": (15, 8), "Malay/Indonesian": (18, 8), "Javanese": (15, 6), "Samoan": (18, 6), "Fijian": (12, 6),
- "Afro-Asiatic": (-10, 2), "Semitic": (-12, 0), "Berber": (-10, 0), "Chadic": (-8, 0),
- "Arabic": (-14, -2), "Hebrew": (-12, -2), "Amharic": (-10, -2),
- "Hausa": (-8, -2),
- "Dravidian": (10, 2), "Tamil": (8, 0), "Telugu": (10, 0), "Kannada": (12, 0), "Malayalam": (14, 0),
- }
- edges = [
- ("Indo-European", "Germanic"), ("Indo-European", "Romance"), ("Indo-European", "Slavonic"), ("Indo-European", "Celtic"), ("Indo-European", "Indo-Iranian"), ("Indo-European", "Hellenic"),
- ("Germanic", "West Germanic"), ("Germanic", "North Germanic"),
- ("West Germanic", "English"), ("West Germanic", "Dutch"), ("West Germanic", "German"), ("West Germanic", "Afrikaans"), ("West Germanic", "Yiddish"), ("West Germanic", "Frisian"),
- ("North Germanic", "Swedish"), ("North Germanic", "Danish"), ("North Germanic", "Norwegian"), ("North Germanic", "Icelandic"), ("North Germanic", "Faroese"),
- ("Romance", "Portuguese"), ("Romance", "Spanish"), ("Romance", "Italian"), ("Romance", "French"), ("Romance", "Romanian"),
- ("Slavonic", "East Slavonic"), ("Slavonic", "West Slavonic"), ("Slavonic", "South Slavonic"),
- ("East Slavonic", "Russian"), ("East Slavonic", "Ukrainian"), ("East Slavonic", "Belarusian"),
- ("West Slavonic", "Polish"), ("West Slavonic", "Czech"), ("West Slavonic", "Slovak"),
- ("South Slavonic", "Bulgarian"), ("South Slavonic", "Serbo-Croatian"), ("South Slavonic", "Slovenian"),
- ("Celtic", "Irish"), ("Celtic", "Welsh"), ("Celtic", "Scottish Gaelic"),
- ("Indo-Iranian", "Hindi"), ("Indo-Iranian", "Bengali"), ("Indo-Iranian", "Persian"),
- ("Hellenic", "Greek"),
- ("Sino-Tibetan", "Chinese"), ("Sino-Tibetan", "Tibetan"), ("Sino-Tibetan", "Burmese"),
- ("Chinese", "Mandarin"), ("Chinese", "Cantonese"),
- ("Austronesian", "Malagasy"), ("Austronesian", "Tagalog"), ("Austronesian", "Malay/Indonesian"), ("Austronesian", "Javanese"), ("Austronesian", "Samoan"), ("Austronesian", "Fijian"),
- ("Afro-Asiatic", "Semitic"), ("Afro-Asiatic", "Berber"), ("Afro-Asiatic", "Chadic"),
- ("Semitic", "Arabic"), ("Semitic", "Hebrew"), ("Semitic", "Amharic"),
- ("Chadic", "Hausa"),
- ("Dravidian", "Tamil"), ("Dravidian", "Telugu"), ("Dravidian", "Kannada"), ("Dravidian", "Malayalam"),
- ]
- examples = {
- "milk": {"Germanic": "milk, melk, mjölk, Milch", "Romance": "leite, leche, latte, lait"},
- "days": {"Germanic": "måndag, tisdag...fredag", "Romance": "lundi, mardi...vendredi"}
- }
- example_positions = {
- "milk": (-15, 12),
- "days": (20, 12)
- }
- # Create a figure with adjusted positions
- plt.figure(figsize=(25, 20))
- # Draw nodes with adjusted positions
- for node, (x, y) in positions.items():
- plt.text(x, y, node, fontsize=12, ha='center', bbox=dict(facecolor='lightblue', edgecolor='black', boxstyle='round,pad=0.3'))
- # Draw edges
- for edge in edges:
- start, end = edge
- sx, sy = positions[start]
- ex, ey = positions[end]
- plt.plot([sx, ex], [sy, ey], 'k-', lw=2)
- # Add examples and symbols
- for example, texts in examples.items():
- x, y = example_positions[example]
- for family, text in texts.items():
- plt.text(x, y, f"{family}: {text}", fontsize=10, ha='left', bbox=dict(facecolor='lightgreen', edgecolor='black', boxstyle='round,pad=0.3'))
- y -= 1.5
- # Add title
- plt.title("Language Families Mental Map", fontsize=20)
- # Hide axes
- plt.axis('off')
- # Save the plot as a JPG file with adjusted positions
- output_path = "Language_Families_Mental_Map_Adjusted.jpg"
- plt.savefig(output_path, format='jpg')
- # Show the path of the saved file
- output_path
[text] CODEVUA
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: