I have an virtual environment, which already has matplotlib packages installed. When I run the code below I get the error:
This is the script code:
import cv2 as c
from matplotlib import pyplot as plt
img = c.imread('ava.png',0)
hist, binst = np.histogram(img.flatten(),256,[0,256])
cdf = hist.cumsum()
cdf_normalized = cdf * hist.max() / cdf.max()
plt.plot(cdf_normalized,color = 'b')
plt.hist(img.flatten(),256,[0,256], color = 'r')
plt.xlim([0,256])
plt.legend(('cdf','histogram'), loc = 'upper left')
plt.show()