Python Final: numPy, sciPy, and matplotlib
I want to make a plot of a variable called d. Which of the following options will do that for me? (a) plt.matshow(d) (b) plt.show(d) (c) matplotlib.matshow(d) (d) plt.makeplot(d)
(a) plt.matshow(d)
I've already made a plot of a variable called d, and now I want to make it show up using my interpreter. How should I do that? (a) plt.show(d) (b) plt.show() (c) plt.showplot() (d) plt.showplot(d)
(b) plt.show()
I want to create a plot in Python. Of the following answers, please pick the one that uses ONLY the correct module(s) and imports it/them correctly: (a) import numpy.pyplot (b) import numpy AND import matplotlib (c) import matplotlib.pyplot (d) import sciPy
(c) import matplotlib.pyplot
I want to use Python to generate an array of 20 evenly spaced numbers between 0 and 3. How should I do this? (a) array = [] for i in range (20): number = random.randint(0, 3) array.append(number) (b) array = [] for i in range (20): number = random.randint(0, 3) array.append(number) (c) np.linspace(0, 3, 20) (d) np.linspace(20, 0, 3)
(c) np.linspace(0, 3, 20)
If I want to get my plot of the variables x and y to appear as a dot plot, how should I do that? (a) plt.plot(x, y, dot) (b) plt.plot(dot, x, y) (c) plt.plot('o', x, y) (d) plt.plot(x, y, 'o')
(d) plt.plot(x, y, 'o')
