Matplotlib Flashcards

1
Q

How do you import matplotlib?

A

import matplotlib.pyplot as plt

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

What is the basic function to plot?

A

plt.plot()

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

How would you adjust the axis of your plot?

A

plt.axis()

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

What is the function to add a title?

A

plt.title(“My title”)

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

How would you add or change the x and y labels?

A

plt.xlabel(“This is my x label”), plt.ylabel(“Y label”)

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

Plot a histogram

A

plt.hist()

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

Plot a scatter plot

A

plt.scatter()

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

Plot a pie chart

A

plt.pie()

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

How would you add a legend?

A

plt.legend()

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

Provide three features that you can change in your plots:

A

bins, width, color, shape

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