Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Matplotlib + Seaborn

Total questions: 15

Worksheet time: 11mins

Name
Class
Date
1.

In plt.figure(figsize=(8,5)), what does (8,5) mean?

a)

(rows, columns) in subplot

b)

(width, height) in inches

c)

(x-limit, y-limit)

d)

(font-size, line-width)

2.

To plot multiple graphs in one figure, which is used?

a)

plt.groupplot()

b)

plt.subplots()

c)

plt.multiplot()

d)

plt.subplot()

3.

Seaborn is built on top of which library?

a)

NumPy

b)

Pandas

c)

Matplotlib

d)

Plotly

4.

Which plot is best for showing relationship between 2 numerical variables?

a)

sns.boxplot()

b)

sns.scatterplot()

c)

sns.countplot()

d)

sns.barplot()

5.

Which plot is used for categorical vs numeric comparison?

a)

sns.barplot()

b)

sns.lineplot()

c)

sns.regplot()

d)

sns.kdeplot()

6.

Which Matplotlib function is best for visualizing distribution as histogram + KDE-like smoothing?

a)

plt.hist()

b)

plt.kde()

c)

plt.smooth_hist()

d)

Matplotlib cannot do KDE directly

7.

When using subplots, what does fig, ax = plt.subplots(2,2) return?

a)

fig and a list of 2 axes

b)

fig and a 2x2 NumPy array of Axes

c)

only figure

d)

only axes

8.

Which Seaborn plot is best for showing relationship + regression line?

a)

sns.scatterplot()

b)

sns.regplot()

c)

sns.regression()

d)

sns.relationship()

9.

What is the major difference between sns.barplot() and sns.countplot()?

a)

Both count frequency

b)

countplot works only for numeric data

c)

barplot cannot show confidence intervals

d)

barplot shows mean/estimator while countplot shows counts

10.

What does hue do in Seaborn plots?

a)

Changes axis label

b)

Splits data into subclass categories with colors

c)

Adds 3D effect

d)

Adds grid automatically

11.

In sns.boxplot(), what do the whiskers represent by default?

a)

Min and max always

b)

Mean and std

c)

1.5 * IQR range

d)

Median and mode

12.

Which plot is best to detect outliers in categorical vs numeric data?

a)

sns.lineplot()

b)

sns.boxplot()

c)

sns.heatmap()

d)

sns.countplot()

13.

If you want to plot distribution of a numeric variable split by category, best choice is:

a)

sns.histplot(data=df, x="salary", hue="gender")

b)

sns.countplot(data=df, x="salary", hue="gender")

c)

sns.scatterplot(data=df, x="salary", y="gender")

d)

sns.heatmap(df["salary"])

14.

Which is TRUE about plt.subplot(221)?

a)

(2 rows, 2 cols, 1st plot)

b)

(2 rows, 2 cols, 2nd plot)

c)

(221 rows, 1 col)

d)

Error

15.

In sns.boxplot(), the line inside the box represents:

a)

Mean

b)

Median

c)

Mode

d)

Standard deviation