I want to plot two different histograms in different plots but opening in same window. With the following code, I am getting two histogram in same plot. I could not get the histogram with subplot don't know where I went wrong.
from matplotlib import pyplot as plt
img = cv2.imread(f)
img1 = cv2.imread('compressed_' + f)
color = ('b', 'g', 'r')
for i, col in enumerate(color):
histr = cv2.calcHist([img], [i], None, [256], [0, 256])
hist = cv2.calcHist([img1], [i], None, [256], [0, 256])
plt.plot(histr, color=col)
plt.plot(hist, color=col)
plt.xlim([0, 256])
plt.title('Original image')
plt.show()