Home /
Expert Answers /
Computer Science /
in-17-import-matplotlib-pyplot-as-plt-import-matplotlib-image-as-im-import-numpy-as-np-hotcat-i-pa481
(Solved):
In [17]: import matplotlib.pyplot as plt import matplotlib.image as im import numpy as np hotcat i ...
In [17]: import matplotlib.pyplot as plt import matplotlib.image as im import numpy as np hotcat im.imread("images/hotcat.jpg") plt.rcParams['figure.figsize'] = [10, 5] plt.hist (hotcat [:,:,0].ravel(), bins=100, alpha=0.7, color="magenta") plt.hist (hotcat[:,:,2].ravel(), bins=100, alpha=0.7, color="indigo") plt.title("Hot Cat") plt.xlabel("x axis") plt.ylabel("y axis") plt.show() Hot Cat 20000 17500 15000 12500 >10000 7500 bout 5000 T 2500 0 100 150 x axis Q2b Explanation 1. What the plt.hist command is doing, including the arguments: • this is used to plot a histogram. 2. How the first argument in plt.hist works: 3. What the plot shows: 200 250