To calculate the slope of a graphic you have to compare two points.
I'll use the ones marked with a dot.
One is the y- intercept(b) of the line P₁ (0,2)
The other one is P₂ (-1,-1)
The formula to use is
m= slope
y₁ and x₁ represent the coordinates of the first point
y₂ and x₂ represent the coordinates of the second point
The slope of the linear function is m=3
y= b + mx
b= y-intercept (value of y when x=0)
y= 2 + 3x