Skip to content
0

Numeria: The Better Story

🐉 In the heart of Numeria...

In the heart of Numeria, each kingdom teems with life, brimming with magical creatures that give character and charm to their enchanted lands. This chart unveils the hidden populations across these mystical realms.

As you can see, the Enchanted Forest and Twilight Plains are the two most populous regions, each housing over 100 mystical beings. The Enchanted Forest, home to the highest number of creatures, stands as a beacon of magic, with Elves, Fairies, and Trolls inhabiting its lush groves and secret pathways. Following closely is the Twilight Plains, where Unicorns graze freely and the air hums with the presence of Fairies.

Further out, the Whispering Woods and Crystal Caves each host their own vibrant communities, adding to Numeria’s magical diversity.

At the kingdom’s edge lies Shimmering Shores, quieter but no less magical, where Goblins and Elves live in smaller numbers.

One striking observation from this magical landscape is the dominance of Trolls, represented by the deep plum, especially in the rugged Mystic Mountains. Their presence overshadows many other creatures in this kingdom. Meanwhile, Unicorns, with their soft lavender glow, and Fairies in emerald green are found in more balanced numbers, gracing nearly every kingdom with their charm. Though mighty, Dragons, depicted in vivid coral, have a more modest presence across Numeria, adding just a touch of their fiery magic to each realm.

import pandas as pd
import matplotlib.pyplot as plt

# Load the dataset
data = pd.read_csv('magical_creatures_by_kingdom.csv')

# Get the unique creature types
unique_creatures = data['CreatureType'].unique()

# Assign the colors to each creature type
creature_colors = {
    'Dragon': '#FF6F61',  # Vivid Coral
    'Unicorn': '#D6A9E5',  # Bright Lavender
    'Fairy': '#A0D6B4',     # Light Emerald
    'Goblin': '#F9D85D',    # Golden Yellow
    'Elf': '#7FB3E5',        # Ocean Blue
    'Troll': '#8B5C99'       # Deep Plum
}

# Pivot the data to get creature counts for each kingdom
pivot_data = data.pivot(index='Kingdom', columns='CreatureType', values='Number_of_Creatures').fillna(0)

# Calculate total population for each kingdom
pivot_data['Total'] = pivot_data.sum(axis=1)

# Sort kingdoms by total population in descending order
sorted_pivot_data = pivot_data.sort_values(by='Total', ascending=False)

# Create the stacked bar chart
fig, ax = plt.subplots(figsize=(12, 6))

# Set the background color for the entire figure (outer part)
fig.patch.set_facecolor('#FDF6E3')

# Set the background color for the plot area (inner part)
ax.set_facecolor('#FDF6E3')

# Create bars for each creature type in a stacked manner
bottoms = [0] * len(sorted_pivot_data)  # Initialize the bottom values for stacking
for creature in unique_creatures:
    ax.bar(sorted_pivot_data.index, 
           sorted_pivot_data[creature], 
           bottom=bottoms, 
           color=creature_colors[creature], 
           label=creature, 
           edgecolor=None)  # Remove edge lines for a cleaner look
    # Update the bottoms for the next layer
    bottoms = [bottoms[i] + sorted_pivot_data[creature][i] for i in range(len(bottoms))]

# Adding titles and labels
ax.set_title('Total Population per Kingdom in Numeria', fontsize=20)
ax.set_xlabel('Kingdom', fontsize=18)
ax.set_ylabel('Total Population', fontsize=18)

# Increase the size of kingdom names
ax.set_xticklabels(sorted_pivot_data.index, fontsize=12)

# Add a legend that maps colors to creature types with bigger title
ax.legend(title="Creature Types", fontsize=10, title_fontsize=12, handlelength=4, handleheight=1.5)

# Remove grid lines for a cleaner look
ax.grid(False)

# Remove the right and top spines (lines)
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)

# Keep only the left and bottom spines (axes lines)
ax.spines['left'].set_linewidth(1.5)
ax.spines['bottom'].set_linewidth(1.5)

# Display the sorted stacked bar chart
plt.tight_layout()
plt.show()

⭐ Reflections on the Original Chart and the Improvements Made:

The initial chart was much more basic and lacked depth. A single line plot without clear labels or color differentiation made it hard to interpret. It hid the variety and richness of the data by focusing only on the total population per kingdom without distinguishing the different types of creatures.

In contrast, the current version:

•⁠ Stacks the data by creature type, providing a clear breakdown of each kingdom's population.

•⁠ Uses a visually appealing color scheme that reflects the magical, medieval theme while being modern and soft on the eyes.

•⁠ Orders the kingdoms by total population, making it easier to see which regions are more populated.

•⁠ Provides clear legends and labels for improved readability, enhancing both the functionality and aesthetic appeal.