0% found this document useful (0 votes)
2 views

Lab 6

Uploaded by

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

Lab 6

Uploaded by

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

1

import matplotlib.pyplot as plt

year = [2018, 2019, 2020, 2021, 2022]


india = [100.6, 150.6, 370.8, 450, 499]
bang = [101, 345, 211, 321, 455]

plt.plot(year, india, color="orange", label="India")


plt.plot(year, bang, color="green", label="Bangladesh")

plt.xlabel("Years")
plt.ylabel("Power Consumption in kWh")
plt.title("Electricity Consumption of India")
plt.legend()

plt.show()

2
import matplotlib.pyplot as plt
overs =
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
runs_scored =
[0,7,12,20,39,49,61,83,86,97,113,116,123,137,145,163,172,
192,198,198,203]
plt.plot(overs, runs_scored, marker='X',
linestyle='dashed', color='red', linewidth=2,
markerfacecolor='blue', markersize=8)
plt.xlabel('Overs', color='green')
plt.ylabel('Runs scored', color='green')
plt.title('Run scoring in a T20 Cricket Match')
plt.grid(True)
plt.show()

You might also like