对计算机随机采样点列图像
代码
import random
from matplotlib import pyplot as plt
import matplotlib
matplotlib.rcParams['font.family'] = 'SimHei'
a = []
b = []
c = []
d = []
for i in range(5):
a1 = random.randrange(10)
b1 = random.randrange(20)
c1 = random.randrange(10)
d1 = random.randrange(20)
a.append(a1)
b.append(b1)
c.append(c1)
d.append(d1)
a.sort()
b.sort()
c.sort()
d.sort()
plt.plot(a,b,'-.',label='ab')
plt.plot(c,d,'-.',color='r',label='cd')
plt.xlabel('x轴随机列表点')
plt.ylabel('y轴随机列表点')
plt.title('对计算机随机采样点的图像分析',fontsize=20)
plt.legend()
plt.show()