wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Matplotlib Unit - 4

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which library is the most used visulization library in python?

a)

Visual

b)

Matlibplot

c)

Matplotlib

d)

matlab

2.

Which function of matplotlib can be used to create a line chart?

a)

Line

b)

Plot

c)

Graph

d)

Bar

3.

Which is not an accepted line style in matplotlib.

a)

'-'

b)

'--'

c)

'-,'

d)

'<'

4.

Which graph should be used If we want to find patterns in data?

a)

bar

b)

histogram

c)

scatterplots

d)

basemap

5.

To show the grid lines in plot, we can write _______________ #plt is an alias of matplotlib.pyplot

a)

plt.grid( )

b)

plt.grid(True)

c)

Both of the above

d)

plt

6.

to add a title in the chart we use the function

a)

title("title of the chart")

b)

plt.title("title of the chart")

c)

plt.title(title of the chart)

7.

Which of the codes below should we use to rotate the data ticks on x-axis?

a)

plt.xticks(rotation=30)

b)

plt.ylabel(rotation=30)

c)

plt.yticks(rotation=30)

d)

plt.xlabel(rotation=30)

8.

Which code should we use to display our graphs?

a)

plt.display()

b)

plt.graph()

c)

plt.show()

d)

plt.chart()

9.

pyplot is also a python library.

a)

False

b)

True

10.

This is an example of a ___________.

a)

Scatter Chart

b)

Line Graph

c)

Bar Graph

d)

Pie Chart

11.

We can use matplotlib without installing the library.

a)

True

b)

False

12.
a)

df.plot( type = ‘hist’, edge = ‘red’)

b)

df.plot( type = ‘hist’, line = ‘red’)

c)

df.plot( type = ‘hist’, edgecolor = ‘red’)

d)

df.plot(type = ‘hist’, linecolor = ‘red’)

13.

How can you add a title to a Matplotlib plot?

a)

By using the title() function

b)

By using the label() function

c)

By using the text() function

d)

By using the legend() function

14.

What is the purpose of the legend() function in Matplotlib?

a)

To label the x and y axes of a plot

b)

To add a title to a plot

c)

To add annotations to a plot

d)

To label different lines or markers on a plot

15.

How do you set a title for the axis using matplotlib library?

a)

ax.set_title("Axis Title")

b)

ax.title("Axis Title")

c)

ax.axis_title("Axis Title")

d)

ax.setTitle("Axis Title")

16.

Which of the following is correct code to plot line chart with dotted line style

a)

plt.plot(x,y)

plt.linestyle = "dotted"

plt.show()

b)

plt.plot(x,y)

plt.linestyle("dotted")

plt.show()

c)

plt.plot(x,y,linestyle = "dotted")

plt.show()

d)

All are correct

17.

Which of the following is used to set the limit of x-axis of the plot?

a)

Limit()

b)

Limits()

c)

Xlimit()

d)

Xlimits()

18.

By default hist() uses bin value of _______

a)

5

b)

10

c)

15

d)

20

19.

To add complexity to the pie chart, you can draw it with a slice extracted from the pie.

a)

shatter

b)

explode

c)

burst

d)

inplode

20.

_______ chart is characterized by a series of sectors that extend radially; each of these areas will occupy a certain angle.

a)

3D surfaces

b)

contour

c)

pie

d)

polar