Visualizations

Graphs showcasing sales data patterns, trends, and insights—all powered by Python, Matplotlib, and Seaborn. Hover or tap on cards to flip.

1. Customer Age Distribution

Histogram of customer age

Shows age distribution to identify key shopper demographics.

Python Code

import seaborn as sns
plt.figure(figsize=(8,5))
sns.histplot(df['Age'], bins=12, kde=True)
plt.title('Customer Age Distribution')
plt.show()
Preview Plot

2. Sales by Product Category

Bar chart of sales by product category

Visualizes which product categories contribute most to sales.

Python Code

import seaborn as sns
plt.figure(figsize=(9,5))
sns.barplot(x='Category', y='Total_Sales', data=df)
plt.title('Total Sales by Product Category')
plt.xticks(rotation=45)
plt.show()
Preview Plot

3. Total Purchases by Month

Monthly purchases line graph

Tracks purchases over months to highlight seasonal patterns.

Python Code

sns.lineplot(data=df, x='Month', y='Total_Purchases')
plt.title('Monthly Purchase Trends')
plt.xticks(rotation=45)
plt.show()
Preview Plot

4. Payment Method Distribution

Pie chart of payment methods

Displays the share of each payment method used by customers.

Python Code

counts = df['Payment_Method'].value_counts()
plt.figure(figsize=(8, 8))
plt.pie(counts, labels=counts.index, autopct='%1.1f%%')
plt.title('Distribution of Payment Methods')
plt.show()
Preview Plot

5. Spending by Customer Segment

Box plot of spending by segment

Compares spending behavior across different customer segments.

Python Code

sns.boxplot(data=df, x='Customer_Segment', y='Amount')
plt.title('Amount Spent by Customer Segment')
plt.show()
Preview Plot

6. Sales by City & Gender

Subplots for sales by city and gender

Side-by-side charts showing city and gender-based sales.

Python Code

# Left: Top Cities
sales_by_city = df.groupby('City')['Total_Amount'].sum()
sns.barplot(x=sales_by_city.index, y=sales_by_city.values)

# Right: By Gender
sales_by_gender = df.groupby('Gender')['Total_Amount'].sum()
sns.barplot(x=sales_by_gender.index, y=sales_by_gender.values)
Preview Plot

7. Correlation Matrix Heatmap

Correlation heatmap

Reveals relationships among numerical variables.

Python Code

corr = df.corr()
plt.figure(figsize=(10, 8))
sns.heatmap(corr, annot=True, cmap='coolwarm')
plt.title('Correlation Matrix')
plt.show()
Preview Plot

8. Top 10 Customers by Spending

Top 10 customers bar chart

Highlights the highest-spending customers.

Python Code

top_customers = df.groupby('Customer_ID')['Total_Amount'].sum().nlargest(10)
sns.barplot(x=top_customers.index, y=top_customers.values)
plt.title('Top 10 Customers')
plt.show()
Preview Plot

9. Income Distribution (Violin Plot)

Violin plot of income

Shows spread of income with density and box components.

Python Code

sns.violinplot(x='Income', y='Total_Amount', data=df)
plt.title('Income Distribution')
plt.show()
Preview Plot

10. Cumulative Sales Over Time

Cumulative sales line graph

Tracks accumulated sales to measure growth.

Python Code

df_sorted = df.sort_values('Date')
df_sorted['Cumulative'] = df_sorted['Total_Amount'].cumsum()
sns.lineplot(data=df_sorted, x='Date', y='Cumulative')
plt.title('Cumulative Sales Over Time')
plt.show()
Preview Plot

11. Product Categories by Segment

Stacked bar chart

Shows product category preferences across segments.

Python Code

stacked = pd.crosstab(df['Product_Category'], df['Customer_Segment'])
stacked.div(stacked.sum(1), axis=0).plot(kind='bar', stacked=True)
plt.title('Product Categories by Segment')
plt.show()
Preview Plot

12. Density Plot of Spending

Density plot of spending

Shows overall distribution shape of spending behavior.

Python Code

sns.kdeplot(df['Amount'], fill=True, color='teal')
plt.title('Density Plot of Spending')
plt.show()
Preview Plot

13. Avg Purchases per Brand (Error Bars)

Error bar plot

Shows variability of average purchases per brand.

Python Code

top_brands = df['Product_Brand'].value_counts().head(10).index
sns.barplot(x='Product_Brand', y='Total_Purchases', data=df[df['Product_Brand'].isin(top_brands)], ci='sd')
plt.title('Avg Purchases per Brand with Error Bars')
plt.show()
Preview Plot