Why Does This Result In a Blank Graph?

  Kiến thức lập trình

This is a version of the code I am trying to run. I have initialized what I need to and need to plot an equation as an array (t is in kelvin, t1 is in degrees celsius). When I run my code, I get a graph with nothing plotted on it. Ironically, the bounds of the graph are consistent with the bounds of t1 and h1 and t1 and h1 are not empty arrays. I believe the values are being taken as a list rather than an integer array. How can I fix this and where is this error coming from?

h1 = [0]*237
t1 = [0]*237

for i in range(len(h1)):
    t = 1064.15
    h1[i]=t
    t1[i]=t-273.15

print(t1[1])

plt.plot(t1, h1, label="1:1.5 810", color='black')
plt.show()

LEAVE A COMMENT