有人知道如何将line chart更改为bar chart吗?
有一个代码:
plt.figure(figsize = (18,12))
plt.subplot(2,2,1)
img = skimage.data.chelsea()
color = ('r','g','b')
for i,col in enumerate(color):
histr = cv2.calcHist([img],[i],None,[256],[0,256])
plt.plot(histr,color = col)
plt.xlim([0,256])
labels= ["red","green", "blue"]
plt.legend(labels)
plt.show()
答案 0 :(得分:1)