Stream Graph

Database Technology Adoption Stream

Stream graph showing the rise of different database technologies over time.

Output
Database Technology Adoption Stream
Python
import matplotlib.pyplot as plt
import numpy as np

COLORS = {
    'background': '#0a0a0f',
    'text': '#ffffff',
    'grid': '#333333',
}

np.random.seed(2323)
years = np.arange(2010, 2025)
n = len(years)

sql = 70 - 0.8 * (years - 2010) + np.random.normal(0, 2, n)
mongodb = 5 + 1.5 * (years - 2010) + np.random.normal(0, 1, n)
redis = 3 + 0.8 * (years - 2012) * (years >= 2012) + np.random.normal(0, 0.5, n)
postgres = 10 + 1.2 * (years - 2010) + np.random.normal(0, 1, n)
elasticsearch = 2 + 0.6 * (years - 2014) * (years >= 2014) + np.random.normal(0, 0.5, n)

data = [np.clip(d, 1, None) for d in [sql, mongodb, redis, postgres, elasticsearch]]
colors = ['#F5B027', '#6CF527', '#F5276C', '#276CF5', '#27D3F5']

fig, ax = plt.subplots(figsize=(14, 6), facecolor=COLORS['background'])
ax.set_facecolor(COLORS['background'])

ax.stackplot(years, *data, colors=colors, alpha=0.85, baseline='sym',
             labels=['MySQL/SQL Server', 'MongoDB', 'Redis', 'PostgreSQL', 'Elasticsearch'])

ax.axhline(0, color=COLORS['grid'], linewidth=0.5, alpha=0.5)
ax.set_xlim(2010, 2024)

ax.set_title('Database Technology Market Share', color=COLORS['text'], fontsize=14, fontweight='bold', pad=15)
ax.set_xlabel('Year', color=COLORS['text'], fontsize=11)
ax.set_ylabel('Usage (%)', color=COLORS['text'], fontsize=11)

ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.12), frameon=False, 
          labelcolor=COLORS['text'], fontsize=9, ncol=5)

for spine in ax.spines.values():
    spine.set_visible(False)
ax.tick_params(colors=COLORS['text'], labelsize=9)

plt.tight_layout()
plt.subplots_adjust(bottom=0.18)
plt.show()
Library

Matplotlib

Category

Time Series

Did this help you?

Support PyLucid to keep it free & growing

Support