0% found this document useful (0 votes)
5 views4 pages

Monthly Test - August - Matplotlib

Matplotlinb notes for ip 065
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)
5 views4 pages

Monthly Test - August - Matplotlib

Matplotlinb notes for ip 065
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/ 4

Monthly Test (August-22)

Class 12 IP

Duration: 90 minutes MM : 40 mks

Section A – 1 Mark each


1 _____________ is a command to install Matplotlib in your system.
2 In order to be able to use Python’s Data Visualisation library, we need to import the
___________________ module from Matplotlib library
3 plt.plot() is used to build a plot, where plt is an ___________
4 ____________ is used to display the figure, if matplotlib.pyplot as mp is imported.
5 Write the function name to draw line chart of two variables.
6 Name the function which is used to save the plot.
7

8 Explain Matplotlib.
9 Write the names of various types of plots offered by matplotlib libtary.
10 Write the name of the attribute to specify the style of the line as dashed in line chart.
Section B – 2 Marks each
11 What is the purpose of a legend?
12 Name any 4 methods used in pyplot.
13 Differentiate between bar chart and histogram.
14 What types of graphs can be plotted using matplotlib?
15 How to change the thickness of line, line style, line color, and marker properties of a chart?
16 Define histogram.
Section C – Q 17,18 3 Marks each
Q 19 – 5 marks
Q 20 – 7 marks
17 Give output for the following program:

import matplotlib.pyplot as plt


india_score=[7,8,4,6,9]
australia_score=[6,5,9,9,7]
over=[1,2,3,4,5]
plt.plot(over,india_score,label="India")
plt.plot(over,Australia_score,label="Australia")
plt.xlabel("Name of Country")
plt.ylabel("Scoring rate in 5 overs")
plt.legend()
plt.show()

18 Ramesh is an IP student. He is working on Data Visualization. His teacher has assigned him a task to create a line
chart to show rainfall in Jaipur from 2001 to 2005. His code produced the following output:

Write code to produce this output.

19 Mr. Vijay is working in the mobile app development industry and he was comparing the given chart
on the basis of the rating of the various apps available on the play store.

He is trying to write a code to plot the graph. Help Mr. Vijay to fill in the blanks of the code and get
the desired output.
import ________________ as plt #Statement 1

apps=["Arogya Setu","WPS Office","Cam Scanner","WhatsApp","Telegram"]

ps_rating=[3.9,4.5,4.6,4.2,4.3]

plt.__________(apps,ps_rating,color='m',label=__________) #Statement 2 Statement 3

plt.xlabel("Apps")

plt._____________("Rating") #Statement 4

plt._________ #Statement 5

plt.________ #Statement 6

i) Write the appropriate statement for #statement 1 to import the module.


ii) Write the function name and label name as displayed in the output for #statement 2 and #statement 3
respectively.
iii) Which word should be used for #statement 4?
iv) Write appropriate method names for #Statement 5 to display legends and #Statement 6 to open the
figure.
v) Mr. Vijay wants to change the chart type to a line chart. Which statement should be updated and which
method or function is used?

20 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 the marker as given in the output.

v) Name the parameter and values used to apply line style as given in the output.

vi) How to apply the line colours as given in the figure?

vii) Write to save the figure as image.

You might also like