Complete the code to import the colormap module from matplotlib.
from matplotlib import [1]
The cm module in matplotlib contains colormaps used for coloring plots.
Complete the code to create a sequential colormap called 'Blues'.
cmap = cm.[1]Blues is a sequential colormap that goes from light to dark blue.
Fix the error in the code to get a diverging colormap named 'PiYG'.
div_cmap = cm.[1]PiYG is a diverging colormap useful for data with a meaningful midpoint.
Fill both blanks to create a qualitative colormap named 'Set1' and apply it to a scatter plot.
scatter = plt.scatter(x, y, c=labels, cmap=cm.[1]) plt.colorbar(scatter, cmap=cm.[2])
Set1 is a qualitative colormap good for categorical data. It is used both in the scatter and colorbar.
Fill all three blanks to create a dictionary of colormaps for each type and print the name of the sequential colormap.
colormaps = {
'sequential': cm.[1],
'diverging': cm.[2],
'qualitative': cm.[3]
}
print(colormaps['sequential'].name)viridis is a popular sequential colormap, PiYG is diverging, and Set1 is qualitative.