wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Review Module 15 - Plotting

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

Which function takes an optional format string argument to specify the color and style of the plotted line?

a)

plt.show()

b)

plt.imshow()

c)

plt.legend()

d)

plt.plot()

2.

Which property is required for plt.legend()?

a)

alpha

b)

data

c)

visible

d)

label

3.

Which package is used for plotting in Python?

a)

matlab

b)

ggplot

c)

matplotlib

d)

matlablib

4.

Which function plots data onto the graph?

a)

plt.show()

b)

plt.imshow()

c)

plt.legend()

d)

plt.plot()

5.

Which function is used to add text labels to a plot?

a)

plt.title()

b)

plt.xlabel()

c)

plt.legend()

d)

plt.text()

6.

Identify the correct syntax for text() function to display 'X Y Plot' at the coordinates (x,y) in grey color and font size 12.

a)

plt.text('X Y Plot', [x,y], color='grey', fontsize=12)

b)

plt.text((x,y), 'X Y Plot',color='grey', fontsize=12)

c)

plt.text(x,y, 'X Y Plot', color='grey', fontsize=12)

d)

plt.text([x,y], 'X Y Plot', color='grey', fontsize=12)

7.

Identify the correct syntax to annotate the data point at (5,2) placing the text 'Peak' at (5,3).

a)

plt.annotate('Peak', xy=(5, 2), xytext=(5, 3))

b)

plt.annotate('Peak', xy=(5, 3), xytext=(5, 2))

c)

plt.annotate(xy=(5, 2), xytext=(5, 3))

d)

plt.annotate(xy=(5, 3), xytext=(5, 2))

8.

Which package provides tools for scientific and mathematical computations in Python?

a)

pandas

b)

numpy

c)

sklearn

d)

matplotlib

9.

The _____ function is used to create a second axis on a plot.

a)

xaxis()

b)

axisr()

c)

twinx()

d)

axhline()