I am trying to plot a horizontal line over another plot using matplotlib. Everything works except the title and axis labels never show up. How does this work?
*Edit-sorry, code looks sort of like this: from matplotlib import pyplot as plt n=100
plt.axhline(y=n, label='Old')
plt.plot([5, 6, 7, 8], [100, 110, 115, 150], 'ro', label='New')
plt.xlabel=('Example x')
plt.ylabel=('Example y')
plt.title=('Example Title')
plt.legend()
plt.axis([0,10,50,150])
plt.show()
Everything shows up normally just no title and no axis labels. The legend is there.
plt.xlabel,plt.title, etc. are functions you call, not attributes to be assigned to. - mwaskom=signs as in:plt.xlabel("Example x"). - MaxNoe