0% found this document useful (0 votes)
7 views2 pages

Python Journal

The document outlines a series of programming tasks using Python libraries Matplotlib and Seaborn for data visualization. It includes instructions for creating various types of plots such as bar charts, histograms, scatter plots, violin plots, pie charts, heatmaps, and box plots with specific requirements for each. The tasks involve manipulating data, adding titles, labels, and customizing visual elements.

Uploaded by

sangeetabohra79
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Python Journal

The document outlines a series of programming tasks using Python libraries Matplotlib and Seaborn for data visualization. It includes instructions for creating various types of plots such as bar charts, histograms, scatter plots, violin plots, pie charts, heatmaps, and box plots with specific requirements for each. The tasks involve manipulating data, adding titles, labels, and customizing visual elements.

Uploaded by

sangeetabohra79
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like