Matplotlib Flashcards

(13 cards)

1
Q

How is grayscale image data represented?

A

As a 2D array where each pixel stores a tuple of intensity values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is RGB(A) image data represented?

A

As a 3D array: 2 spatial dimensions plus 1 color-channel dimension (red, green, blue, optional alpha).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the file suffix and key property of JPEG?

A

.jpg or .jpeg; pixel-based raster graphics with lossy compression (data lost on save).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the file suffix and key property of PNG?

A

.png; pixel-based raster graphics with lossless compression (no data lost).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the file suffix and key property of SVG?

A

.svg
vector-based graphics drawn from specifications;
no resolution loss when zooming;
lossless compression;
natively supported by matplotlib

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When is SVG preferred?

A

For images where resolution matters and vector design is possible (e.g., line plots, histograms, diagrams).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a matplotlib backend?

A

The system-specific engine that renders plots. Different backends support interactivity, animations, or 3D plots.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why might a plot look different on different operating systems?

A

Because different backends are used depending on the OS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Difference between interactive and non-interactive modes in matplotlib?

A

Interactive shows plots immediately; non-interactive requires explicit show commands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Figure in matplotlib?

A

The overall window or canvas for plotting; supports interaction and can be saved as an image file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is an Axes in matplotlib?

A

The object inside a figure where data is actually plotted. A figure can contain multiple Axes, and you can draw to each multiple times.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How is ‘Axis’ different from ‘Axes’ in matplotlib terminology?

A

Axis refers to number lines (x-axis, y-axis), whereas Axes refers to the plotting area object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

An alpha channel in RGB images represents …?

A

opacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly