I am trying to create a plot with titles but getting this error I am using spyder 3.7
Error:
plt.title("Year vs Population in Bulgaria")
TypeError: 'str' object is not callable
Code:
import matplotlib.pyplot as plt
years = [1983, 1984, 1985, 1986, 1987]
total_populations = [8939007, 8954518, 8960387, 8956741, 8943721]
plt.plot(years, total_populations)
plt.title("Year vs Population in Bulgaria")
plt.xlabel("Year")
plt.ylabel("Total Population")
plt.show()
It should show the title. I have removed and use it other options but I still have issues I cant figure out
pltthat might be getting called instead?print(plt)return?