I'm really new to python but I made a program which produced data I want on a line graph. I know how to use bar graphs, but I haven't found any method (I can understand or can use without throwing an error) to make a line graph.
Here is an example me trying to plot some data:
import matplotlib.pyplot as plt
x = []
y = []
width = 0.5
for i in range(100):
x.append(i)
y.append(i)
_ = plt.xlabel('Number of moves')
_ = plt.ylabel('Frequnecy')
_ = plt.bar(x, y, color='r', width=width)
plt.show()
All I want to know is how to convert data like the one in the for loop into a line graph. Try to think of the simplest way of doing it because I'm not very smart. An explanation attached to the solution would be greatly appreciated.
Cheers, Evan.
EDIT: Thanks to an answer-er, I solved the problem. I would also like to know how to add a title to a graph, and also I want to know how to increase the length of the line of the x-axis (the data of my graph is kind of squished).