Arrange the following steps to draw a customized scatter plot using matplotlib.
(A) import pandas as pd
(B) use plt.scatter() with customized color, size and marker style
(C) create two data series for x and y values
(D) add labels, title and display the plot
Arrange the following steps to draw a customized scatter plot using matplotlib.
(A) import pandas as pd
(B) use plt.scatter() with customized color, size and marker style
(C) create two data series for x and y values
(D) add labels, title and display the plot
Solution
Libraries must be imported first, and the data must exist before it can be plotted. Only then can the scatter plot be customized, and the labels, title and display call come last, because plt.show() renders the finished plot.
(A) import pandas as pd
(C) create two data series for x and y values
(B) use plt.scatter() with customized color, size and marker style
(D) add labels, title and display the plot
Options 2 and 3: call plt.scatter() before the x and y data exist, which gives an error.
Option 4: puts the import last, but the code cannot run without its libraries imported first.
Related questions:
2026: 20 May Shift 1
2026: 13 May Shift 2
2026: 26 May Shift 1
2025: 13 May Shift 2
2026: 11 May Shift 2
