[go: up one dir, main page]

0% found this document useful (0 votes)
6 views3 pages

21bei042 Prac06

Uploaded by

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

21bei042 Prac06

Uploaded by

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

Course Name – SCIENTIFIC PROGRAMMING

Name-Meena Rangrej

Roll no -21BEI042

EXPERIMENT – 06

AIM: To implement the matplotlib

1 . https://www.kaggle.com/code/leonlxy/matplotlib-tutorial-with-exercises-1

2. Plot a line graph that shows in the figure for the given data. The runs scored between
two-wicket fall in a one-day international match between India and England is generated
using randomly.

CODE:

#matplot
#.Plot a line graph
import numpy as np
from matplotlib import pyplot as plt
wicket=np.arange(0,10)
india=np.cumsum(np.random.random(10))
england=np.cumsum(np.random.random(10))
plt.bar(wicket,india,label='india',color='purple')
plt.bar(wicket,england,label='england',color='green')
plt.xlabel("wicket")
plt.ylabel("run")
plt.title("SCOREBOARD")
plt.legend()
plt.show()
GRAPH:
CODE:
#matplot
#.Plot a line graph

import numpy as np
from matplotlib import pyplot as plt
wicket=np.arange(0,10)
india=np.cumsum(np.random.random(10))
england=np.cumsum(np.random.random(10))
width1=0.25

plt.bar(wicket-width1, india, width=width1, label='india')


plt.bar(wicket,england , width=width1, label='england')
plt.xlabel("wicket")
plt.ylabel("run")
plt.title("SCOREBOARD")
plt.legend()
plt.show()

GRAPH:
CONCLUSION:
In this practice , we have learnt about the matplotlib function . We have implemented the
code in python and also plotted the graph using the cumulative sum of both the teams i.e
India and England.

You might also like