import matplotlib.pyplot as plt
import numpy as np

# 从[-1,1]中等距去50个数作为x的取值
# x = np.linspace(-1, 1, 50)
base= 1024
x = [1,2,3,4,5,6,7]
# y = [43,9,11,17,11,44,1041,1659,2034,2285,1976,2422,2332,2324,2124,1861,1993,2144,2419,1190,2970,1244,787,349]
y = [7,7,8,7,3,14,321,14,22,23,1,998,23,114,1,1,2,4,142,2,6,5,7,6,]
x = np.array(x)
# y = base + 1/5*base * np.cos(x) 
y = np.cos(x) 
# 第一个是横坐标的值，第二个是纵坐标的值
plt.plot(x, y)
plt.scatter(x, y)
# 必要方法，用于将设置好的figure对象显示出来
plt.show()


