Generating Basic Plots using Matplotlib
[Link] Plot for Temperature Variation
Task:
Plot daily temperature for one week using Matplotlib with labels and titles.
import [Link] as plt
days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
temp = [30, 32, 31, 29, 35, 36, 33]
[Link](days, temp, marker='o', color='teal')
[Link]("Weekly Temperature Variation")
[Link]("Days")
[Link]("Temperature (°C)")
[Link](True)
[Link]()
[Link] Chart of Student Marks
Task:
Display student names on the x-axis and marks on the y-axis.
import [Link] as plt
students = ['Anu', 'Bala', 'Kiran', 'Mohan', 'Ravi']
marks = [78, 82, 90, 85, 88]
[Link](students, marks, color='orange')
[Link]("Student Marks")
[Link]("Students")
[Link]("Marks")
[Link]()
[Link] Chart for Department Strength
Task:
Visualize the strength of students in different departments using a pie chart.
import [Link] as plt
departments = ['CSE', 'ECE', 'EEE', 'MECH', 'CIVIL']
students = [120, 100, 90, 80, 70]
[Link](students, labels=departments, autopct='%1.1f%%', startangle=90)
[Link]("Department-wise Student Strength")
[Link]()