from numpy import random
import matplotlib.pyplot as plt
import numpy as np

xpoints = np.array([1, 2, 3, 4, 5, 6, 7])
ypoints = np.array([ 2 * i - 1 for i in xpoints])

plt.title("Wykres funkcji liniowej")
plt.plot(xpoints, ypoints, marker="o", c='b', label="y = 2x - 1")
plt.legend()

plt.xlabel("Oś x")
plt.ylabel("Oś y")

plt.show()