In [24]:
def toCm(kg):
return (1400/(kg*9.8)) * 100
toCm(83)
Out[24]:
In [22]:
%matplotlib inline
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import csv
x = []
y = []
z = []
# Let's add some specific values.
x.append(196)
y.append(None)
z.append(toCm(196))
print("196 -> " + str(toCm(196)))
x.append(143)
y.append(None)
z.append(toCm(143))
print("143 -> " + str(toCm(143)))
with open('data.csv','r') as csvfile:
plots = csv.reader(csvfile, delimiter=',')
for row in plots:
x.append(float(row[0]))
y.append(float(row[1]) + 23)
z.append(toCm(float(row[0])))
plt.plot(x,y, label='Length official')
plt.plot(x,z, label='Length new')
plt.xlabel('kg')
plt.ylabel('cm')
plt.title('ToD')
plt.legend()
plt.show()
In [ ]: