FYB.
COM-DA(SEM-2)
SUBJECT- Python Libraries for Data Visualization: Matplotlib, Seaborn
Journal Programs
1. students = ['Bella', 'Boby', 'Charlie', 'Diya']
marks = [85, 78, 92, 70]
Create a bar chart with different color bars. Add title and axis labels.
2. ages = [12, 15, 13, 15, 16, 14, 12, 15, 17, 14, 16, 13]
Plot a histogram with 5 bins and color “skyblue”. Add title and labels.
3. x = [5, 7, 8, 7, 2, 17, 2, 9]
y = [99, 86, 87, 88, 100, 86, 103, 87]
Create a scatter plot with red color and marker “o”. Add title and labels.
4. Generate 100 random ages between 18 and 60 using NumPy.
➢ Create a histogram with 10 bins.
➢ Change the color of bars.
➢ Add edge color.
➢ Add grid lines.
➢ Label axes and title.
5. Create marks data for three classes:
Class A
Class B
Class C
➢ Draw a violin plot.
➢ Show inner quartiles.
6. Create a pie chart showing the market share of the following mobile brands:
Samsung – 30%
Apple – 25%
Xiaomi – 20%
Oppo – 15%
Others – 10%
➢ Add a title: "Mobile Market Share 2025"
➢ Show percentage values on the chart.
➢ Explode the highest market share slice.
➢ Change colors of slices.
7. Create sales data for 3 products over 4 months.
➢ Create DataFrame.
➢ Plot heatmap.
➢ Use linewidths parameter.
➢ Add color bar.
8. Create salary data for:
HR Department
IT Department
Sales Department
➢ Plot box plot for all departments.
➢ Change box colors.