Date:02-04-2024
Matplotlib Practicals
1. Draw scatter plot to show relationship between employee’s salary and years of experience
with data in [Link] file (eno, ename, dept, yearsofExp, Salary)
2. Draw pie chart for gender column using [Link] file (eno, ename, gender,
department)
3. Draw group bar chart to show penguin attributes
{ 'Bill Depth': (18.35, 18.43, 14.98),
'Bill Length': (38.79, 48.83, 47.50),
'Flipper Length': (189.95, 195.82, 217.19) }
by species ("Adelie", "Chinstrap", "Gentoo")
4. Draw stacked bar chart to show Number of penguins with above and below average body
mass
weight_counts = {
"Below": [Link]([70, 31, 58]),
"Above": [Link]([82, 37, 66]),
}
by species ("Adelie", "Chinstrap", "Gentoo")
5. Draw stacked bar chart to show Number of penguins by gender
gender_counts = {
'Male': [Link]([73, 34, 61]),
'Female': [Link]([73, 34, 58]),
}
By species = ('Adelie', 'Chinstrap', 'Gentoo')
6. Draw bar chart to show Fruit supply by kind and color with following data
fruits = ['apple', 'blueberry', 'cherry', 'orange']
counts = [40, 100, 30, 55]
bar_labels = ['red', 'blue', '_red', 'orange']
bar_colors = ['tab:red', 'tab:blue', 'tab:red', 'tab:orange']
with ylabel 'fruit supply'
title 'Fruit supply by kind and color' and
legend title='Fruit color'
7. Draw histogram to show height of 250 (generate 250 values using numpy array) people
with given intervals / bins= [140, 150, 160, 170, 180, 190, 200]