I am using Python (3.4) Jupyter Notebook. I tried to plot a histogram with label using the code below.
%matplotlib notebook
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
bins = np.linspace(0, 1.0, 40)
plt.hist(good_tests, bins, alpha = 0.5, color = 'b' , label = 'good')
plt.show()
But the label 'good' doesn't show at all. Did I miss anything? Thanks!
you need to add a legend. See legend for details.
plt.legend()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With