I want the x-axis to be what row the temperature value is in and the y-axis to be the actual value. How do I do this? I printed values to a file into one column.
import matplotlib.pyplot as plt
# get data
with open("data.txt") as myfile:
temps = [float(row) for row in myfile]
# generate line numbers
num_rows = len(temps)
rownums = list(range(num_rows)) # starting at 0!
# plot
plt.plot(rownums, temps)
plt.show()
which gives