Given the coordinates of two distinct points on the line, $(x_0,y_0) \neq (x_1,y_1)$, the whole line can in principle be represented by the graph of the function
$$
y = f(x) := y_0 + \frac{y_1-y_0}{x_1-x_0} (x - x_0).
$$
Notice, however, that this approach fails for $x_0 = x_1$, in which case the line is parallel to the chosen $y$-axis. There are infinitely many such lines.
If we are free to rotate and translate the coordinate system, then this problem can not only be circumvented, but in that case we may even represent any line in the plane by the graph of the function $y = f(x) := 0$, for example (i. e., it lies on the $x$-axis).
Edit:
If an algebraic equation is good enough, then you can represent any line in the plane by the solution set of
$$
(x_1-x_0)(y-y_0) - (y_1-y_0)(x-x_0) = 0,
$$
if the coordinates of two distinct points on the line, $(x_0,y_0) \neq (x_1,y_1)$, are known.