import matplotlib.pyplot as plt
from random import sample, randint
cs_rng = [i for i in range(10)] # Область системы координат
c_num = randint(2,len(cs_rng))# Кол-во точек
x = sorted(sample(cs_rng,c_num))
y = sample(cs_rng,c_num)
plt.figure(facecolor="g")
plt.plot(x,y)
plt.grid()
plt.show()