Pie Chart

Investment Portfolio Mix

Dark theme nested donut showing investment allocation with inner/outer rings

Output
Investment Portfolio Mix
Python
import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots(figsize=(10, 6), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')

# Outer ring - asset classes
assets = ['Stocks', 'Bonds', 'Real Estate', 'Crypto', 'Cash']
allocation = [45, 25, 15, 10, 5]
outer_colors = ['#10b981', '#34d399', '#6ee7b7', '#a7f3d0', '#d1fae5']

# Inner ring - risk level
risk = ['High Risk', 'Medium', 'Low Risk']
risk_alloc = [55, 30, 15]
inner_colors = ['#ef4444', '#eab308', '#22c55e']

# Outer ring
wedges1, texts1, autotexts1 = ax.pie(allocation, labels=assets, autopct='%1.0f%%',
                                      colors=outer_colors, radius=1, startangle=90,
                                      wedgeprops={'width': 0.35, 'edgecolor': '#0a0a0f', 'linewidth': 2})

# Inner ring
wedges2, texts2, autotexts2 = ax.pie(risk_alloc, labels=risk, autopct='%1.0f%%',
                                      colors=inner_colors, radius=0.65, startangle=90,
                                      wedgeprops={'width': 0.3, 'edgecolor': '#0a0a0f', 'linewidth': 2})

for text in texts1 + texts2:
    text.set_color('white')
    text.set_fontsize(9)
for autotext in autotexts1 + autotexts2:
    autotext.set_color('#0a0a0f')
    autotext.set_fontweight('bold')
    autotext.set_fontsize(8)

ax.set_title('Investment Portfolio Mix', fontsize=16, fontweight='bold', color='white', pad=20)
plt.tight_layout()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support