Back to marketplace

matplotlib.pyplot

No description yet. This curated deck is ready for daily study.

Total cards: 15•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (15)

#1
Front (Question)

Import the function which enables you to create simple charts

Back (Answer)

import matplotlib.pyplot as plt

#2
Front (Question)

Which function is the most commonly used from the matplotlib module?

Back (Answer)

pyplot, usually as “plt” variable name

#3
Front (Question)

Create a line plot from x and y datasets

Back (Answer)

plt.plot(x, y)

#4
Front (Question)

Create a scatterplot from x and y datasets

Back (Answer)

plt.scatter(x, y)

#5
Front (Question)

Show the created plot

Back (Answer)

plt.show()

#6
Front (Question)

clean axis

Back (Answer)

plt.cla()

#7
Front (Question)

clean figure

Back (Answer)

plt.clf()

#8
Front (Question)

erase plots and release memory

Back (Answer)

plt.close()

#9
Front (Question)

Create a histogram from dataset x

Back (Answer)

plt.hist(x)

#10
Front (Question)

Create a histogram from dataset x with 30 bins

Back (Answer)

plt.hist(x, bins=30)

#11
Front (Question)

Modify the scale of the x axis to logarithmic scale

Back (Answer)

plt.xscale(‘log’)

#12
Front (Question)

We need a standard world development chart based on GDP per capita and life expectancy. You also have population to include as a third dimension (size), and you have information about the continent (color). Corresponding numpy arrays: gdp, life, pop, col. Make the points slightly transparent to that they can be distinghuised if they are overlapping.

Back (Answer)

plt.scatter(x = gdp, y = life, s = pop, c = col, alpha = 0.8)

#13
Front (Question)

Include the following options on the scatterplot named plt already existing: X label: “GDP” Y label: “Life expectancy” Title: “World Development” X axis ticks: “1000, 10000, 100000” with the labels “1K”, “10K”, “100K”

Back (Answer)

plt. xlabel(“GDP”) plt. ylabel(“Life expectancy”) plt. title(“World Development”) plt. xticks([1000,10000,100000], [“1K”, “10K”, “100K”])

#14
Front (Question)

Add custom text. At coordinates 1550, 71, add “India”.

Back (Answer)

plt.text(1550, 71, “India”)

#15
Front (Question)

Turn on the grid

Back (Answer)

plt.grid(True)