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

Matplotlib Neww

The document provides examples of SQL functions and Python code snippets. It includes examples of SQL substring, mod, left, ltrim, and instr functions. It also includes code to create an empty DataFrame and empty Series object in Python.

Uploaded by

Pooja Singh
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)
18 views3 pages

Matplotlib Neww

The document provides examples of SQL functions and Python code snippets. It includes examples of SQL substring, mod, left, ltrim, and instr functions. It also includes code to create an empty DataFrame and empty Series object in Python.

Uploaded by

Pooja Singh
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

1.

1. Plot following data on bar graph:

English: 56,78,90,34
Science: 65,77,54,32
Maths: 45,67,43,41

2.
. Write code to plot a line chart to depict the run rate of T20 match from given data:

Overs Runs

5 45

10 79

15 145

20 234

3.
Mrs. Namrata is a coordinator in the senior section school. She represented data on number of
students who passed the exam on line chart as follows:

She has written the following code but not getting the desired output. Help her by correcting her code.

import matplotlib.pyplot as plt

classes=["X A","X B","XI A","XI B","XII A","XII B"]


no_of_boys=[23,22,20,26,33,30]
no_of_girls=[17,10,20,12,5,8]
plt.line(classes,no_of_boys) #Statement 1
plt.line(classes,no_of_girls) #Statement 2
plt.xtitle("No of Stduents") #Statement 3
plt.ytitle("Classes") #Statement 4
plt.show()

I) What will be the correct code for Statement 1 and Statement 2?


II) What is the correct function name for Statement 3 and Statement 4?
III) Write a method and parameter required to display legends?
IV) Name the parameter and values used to apply linestyle as given in the output
V) How to apply the line colours as given in the figure?
VI) Write to save the figure as image.

4. Write code to plot a line chart to depict the run rate of T20 match from given data:

Overs Runs

5 45

10 79

15 145

20 234

import matplotlib as pp

overs = [5,10,15,20]

runs = [54,79,145,234]

pp.plot(overs,runs)

pp.xlabel('Overs')

pp.ylabel('Runs')

pp.show()

6.
1.SELECT SUBSTR(‘ABCDEFG’,-5,3);

SELECT MOD(14,3);

SELECT LEFT(‘JAMMU REGION’,5);

SELECT LTRIM(‘ RAJKUMAR ‘);

SELECT INSTR(‘TOOLBARBAR’,’BAR’);

1.

2. PYTHON CODE TO CREATE AN EMPTY DATAFRAME

3. PYTHON CODE TO CREATE AN EMPTY SERIES OBJECT

You might also like