Radar Chart

Customer Segment Behavioral Analysis

Radar chart comparing different customer segments across behavioral metrics like purchase frequency, brand loyalty, price sensitivity, and digital engagement.

Output
Customer Segment Behavioral Analysis
Python
import matplotlib.pyplot as plt
import numpy as np

# Customer behavior dimensions
categories = ['Purchase Frequency', 'Avg Order Value', 'Brand Loyalty',
              'Price Sensitivity', 'Digital Engagement', 'Referral Rate',
              'Product Range', 'Response to Promos']
              
premium = [70, 95, 92, 25, 85, 75, 88, 45]
regular = [85, 60, 70, 65, 70, 55, 65, 78]
bargain = [90, 40, 45, 95, 80, 40, 50, 95]
occasional = [35, 75, 55, 55, 45, 65, 80, 60]

N = len(categories)
angles = np.linspace(0, 2 * np.pi, N, endpoint=False).tolist()
angles += angles[:1]

premium += premium[:1]
regular += regular[:1]
bargain += bargain[:1]
occasional += occasional[:1]

fig, ax = plt.subplots(figsize=(10, 10), subplot_kw=dict(polar=True), facecolor='#ffffff')
ax.set_facecolor('#ffffff')

ax.plot(angles, premium, 'o-', linewidth=2.5, color='#5314E6', label='Premium Buyers', markersize=7)
ax.fill(angles, premium, alpha=0.1, color='#5314E6')

ax.plot(angles, regular, 's-', linewidth=2.5, color='#27D3F5', label='Regular Customers', markersize=7)
ax.fill(angles, regular, alpha=0.1, color='#27D3F5')

ax.plot(angles, bargain, '^-', linewidth=2.5, color='#F54927', label='Bargain Hunters', markersize=7)
ax.fill(angles, bargain, alpha=0.1, color='#F54927')

ax.plot(angles, occasional, 'D-', linewidth=2.5, color='#6CF527', label='Occasional Shoppers', markersize=7)
ax.fill(angles, occasional, alpha=0.1, color='#6CF527')

ax.set_xticks(angles[:-1])
ax.set_xticklabels(categories, fontsize=10, color='#374151', fontweight='500')
ax.set_ylim(0, 100)

ax.yaxis.grid(True, color='#e5e7eb', linestyle='-', linewidth=0.8)
ax.xaxis.grid(True, color='#d1d5db', linestyle='-', linewidth=0.5)
ax.spines['polar'].set_color('#d1d5db')

ax.set_title('Customer Segment Behavioral Profiles', fontsize=16, color='#1f2937',
             fontweight='bold', pad=25)

ax.legend(loc='upper right', bbox_to_anchor=(1.22, 1.1), fontsize=10,
          frameon=True, facecolor='white', edgecolor='#e5e7eb')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Polar Charts

Did this help you?

Support PyLucid to keep it free & growing

Support