2020年12月7日 星期一

mathplotlib(二) y=2x-10的圖形


import matplotlib.pyplot as plt
#求 y=2x-10 的圖形
x=[]
y=[]
for i in range(1,11):
   x.append(i)
for i in range(1,11):
   y.append(2*i-10)
plt.plot(x,y,color="red")
plt.grid(color="0.8")
plt.show()
print(x)
print(y)
 

沒有留言:

張貼留言

二維陣列(2d array) matrix

import numpy as np fru_items=[["apple","banana","cherry","durian","eggplant","fig...