When I execute the following code, it doesn't produce a plot with a label.
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1, 5)
plt.plot(x, x*1.5, label='Normal')
Numpy version is '1.6.2' Matplotlib version is '1.3.x'
Any ideas as to why this is happening?
You forgot to display the legend:
...
plt.legend(loc='best')
plt.show()
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